in reply to Re: Format XML Atom DateTime
in thread Format XML Atom DateTime

Ha, thanks. Regular expressions are a sneaky way of doing this. Occasionally this will not end in a decimal value, so the -0500 of EST will still show up, but this is a minor annoyance that can be fixed. Just for reference, is the xml date format I mentioned able to be identified and re-formatted using Date::Format or another perl module?

Replies are listed 'Best First'.
Re^3: Format XML Atom DateTime
by Anonymous Monk on Feb 26, 2012 at 01:06 UTC

    Just for reference, is the xml date format I mentioned able to be identified and re-formatted using Date::Format or another perl module?

    Never used Date::Format before, but a minute of looking shows its should be able to handle it without any problem

    #!/usr/bin/perl -- use strict; use warnings; use Date::Format(); use Date::Parse(); use feature qw/ say /; my @t = Date::Parse::strptime( q/2012-02-25T18:48:34.835-05:00/); say Date::Format::strftime( q/%Y-%m-%d %H:%M:%S/, @t, ); __END__ 2012-02-25 18:48:34