Greetings,
My thanks to Eugene and Andrew for their quick replies.
In response to Andrew, it's not that I haven't been reading the docs,
it's that I wasn't able to *understand* them. And that's my problem,
not the docs. ;)
I hadn't realized how fundamentally ambiguous the fall back
time-change was in local time. Unfortunately, I'm actually stuck with
local time, so I'm going to have to hack out a solution.
Thanks for the prompting.
Mark
On Apr 8, 2005 11:01 AM, Mark Fox [EMAIL PROTECTED] wrote:
Greetings,
I've got a problem. It's probably a misunderstanding on my part.
Here's a script:
---
#!/usr/bin/perl -w
use strict;
use warnings;
use DateTime;
my $dt1 =
DateTime-new(year = 2004,
month = 10,
day = 31,
hour = 1,
minute = 3,
second = 9,
time_zone = 'America/Edmonton');
print $dt1-datetime(), ' = ', $dt1-epoch(), \n;
my $dt2 =
DateTime-from_epoch(epoch = 1099206189, time_zone =
'America/Edmonton');
print $dt2-datetime(), ' = ', $dt2-epoch(), \n;
---
And here's the output:
---
2004-10-31T01:03:09 = 1099209789
2004-10-31T01:03:09 = 1099206189
---
This is a problem because I have dates that are sometimes specified as
human-readable strings and sometimes as seconds-from-the-epoch. I
convert the former to the latter and then go to work, but for my
purposes I need the same date to map to the same epoch. The whole
point of what I'm doing is to match the dates in human-readable string
to the dates as seconds-from-the-epoch.
What am I doing wrong?
Mark