Hi chronophiles.
I want to serialize my times such that they match this regular expression:
m[^(....)/(..)/(..)T(..):(..):(..)(D?)/(.*)]
where
$1 = year
$2 = month
$3 = day
$4 = hour
$5 = minute
$6 = second
$7 = 'D' if the time is in DST, '' otherwise
$8 = timezone
because I think it's a nice, neat format. My problem comes from
constructing a DateTime object from this string. I include the 'D' in
there to disambiguate times during the repeated hour that comes from
DST. I want to do something like this:
my $dt = new DateTime->new(year => $1,
month => $2,
day => $3,
hour => $4,
minute => $5,
second => $6,
dst => !!$7,
time_zone => $8);
but of course there is no 'dst' parameter to pass to the constructor.
There must be an easy way to the DateTime object taking into account the
DST-ness of the time. Any hints?
Thanks,
Cameron
--
e-mail : cam (at) mcc.id.au icq : 26955922
web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au
office : +61399055779 jabber : heycam (at) jabber.org