On Mon, 3 Feb 2003 [EMAIL PROTECTED] wrote: > There is something else to consider. What does a timestamp of "May 5, > 1776, 4:16:23 PM" actually _mean_? For "May 5, 1976, 4:16:23 PM", > it's clear which point in time we mean when we have the timezone. > But for dates 200 years ago, it isn't so clear. When it was 4 PM here, > it would have been 4:10 PM in the next town, and 3:55 in a town in the > other direction. Second or even minute precision doesn't make much sense > for long ago dates if you don't have a geographical location as well. > > And it becomes even more difficult if you go back further in time. > There was a time when a night lasted 12 hours, a day 10, and one hour > both for dusk and dawn. What do 'seconds' mean for such dates?
Yeah, there's a general problem with thinking about pre-time zone datetimes in modern terms. The time zone code I've written does include all the historical data, but since one are (America/Chicago) is used to represent a large region (all of the midwest US), it kind of breaks down when you get back far enough to be in LMT (local mean time), because you get the LMT for Chicago, not Minneapolis or New Orleans or Fargo. Users who really wanted accurate town to town "time zone" differences could calculate the actual LMT and then use the DateTime::TimeZone::OffsetOnly module (which lets you just specify a fixed offset like "-21514") for datetimes in different towns. Alternately, if you aren't going to be creating times based on local times in multiple locations, then you can just say everything is UTC. This works if you just want to figure out how many months are between May, 1776 and June, 1976, which could be done like this: my $j1976 = DateTime->new( year => 1976, month => 6, time_zone => 'UTC' ); my $m1776 = DateTime->new( year => 1776, month => 5, time_zone => 'UTC' ); my $duration = $j1976 - $m1776; print "There were ", $duration->months, " between the two dates\n"; This should work with the existing code in CVS. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/
