Date::Parse is nothing new, but I haven't ever really needed it until recently when I had to sort a bunch of date strings.
The dates I need to play look like Sun, 25 Apr 2004 16:08:05 +0200. Sometimes they have the time zone, sometimes they don't. Often they have a lot of different time zones.
Small matter to Date::Parse::str2time()
use Date::Parse qw(str2time); my $date = 'Sun, 25 Apr 2004 16:08:05 +0200'; my $epoch_time = str2time( $date );
Once I have the epoch time, it's easy to go back the other way too, using Date::Format, also in the TimeDate package.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: New Favorite Thing: str2time
by Zaxo (Archbishop) on Sep 28, 2004 at 20:20 UTC | |
|
Re: New Favorite Thing: str2time
by TedYoung (Deacon) on Sep 28, 2004 at 20:27 UTC | |
|
Re: New Favorite Thing: str2time
by sshipway (Initiate) on Jul 10, 2014 at 04:32 UTC |