![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
use Date::Parse; $time = str2time($date); ($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);
Date::Parse
provides two routines for parsing date strings into time values.
DATE
and returns a unix time value, or undef upon failure.
ZONE
, if given, specifies the timezone to assume when parsing if the date
string does not specify a timezome.
($ss,$mm,$hh,$day,$month,$year,$zone)
. Elements are only defined if they could be extracted from the date
string. The $zone
element is the timezone offset in seconds from GMT. An empty array is
returned upon failure.
Date::Parse->language('German');
will cause Date::Parse to attempt to parse any subsequent dates in German.
This is only a first pass, I am considering changing this to be
$lang = Date::Language->new('German'); $lang->str2time("25 Jun 1996 21:09:55 +0100");
I am open to suggestions on this.