develooper Front page | perl.datetime | Postings from January 2003

Re: Changing time zones?

Thread Previous | Thread Next
From:
Jonathan Scott Duff
Date:
January 31, 2003 12:49
Subject:
Re: Changing time zones?
Message ID:
20030131144900.B7580@cbi.tamucc.edu
On Fri, Jan 31, 2003 at 10:44:55AM -0600, Dave Rolsky wrote:
> If I do this:
> 
>   # UTC time
>   my $dt = DateTime->new( year => 2000, month => 5, day => 6,
>                           hour => 7, minute => 15, time_zone => 0 );
> 
>   print $dt->hour; # prints 7
> 
>   $dt->set( time_zone => 'America/Chicago' );
> 
>   print $dt->hour; # prints 1 or 7?
> 
> 
> In other words, does setting the time zone cause us to recalculate local
> time based on the current UTC (prints 1), or does it cause us to
> recalculate UTC based on the local time (prints 7).
> 
> I lean towards the former, but we might need both.

recalc local.  always.

If we need both, then there should be another different mechanism for
the latter.  

-Scott
-- 
Jonathan Scott Duff
duff@cbi.tamucc.edu

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About