in reply to Re: Converting dates with Date:Format
in thread Converting dates with Date:Format

Ahhh ok - yeah that makes sense. Is there a better way to change from one format to another? Seems a bit long winded to have to convert one string into a localtime(), then to epoch, and then back again into another format

Thanks!
  • Comment on Re^2: Converting dates with Date:Format

Replies are listed 'Best First'.
Re^3: Converting dates with Date:Format
by poj (Abbot) on Jan 10, 2017 at 07:58 UTC
    use Time::Piece; my $t = Time::Piece->strptime( '2008-11-03 20:15:44',"%Y-%m-%d %H:%M:%S" ); print $t->strftime("%a, %d %b %Y %H:%M:%S %Z");
    poj
      You legend! Works like a charm! Thanks :)