[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-datetime
Subject:    Re: DateTime::Set set_time_zone fix
From:       "Flavio S. Glock" <fglock () pucrs ! br>
Date:       2004-07-01 21:01:31
Message-ID: 40E47BAB.4A39 () pucrs ! br
[Download RAW message or body]

I'm doing some tests with the revised version of DateTime::Set:

Tim.Mueller-Seydlitz.extern@HVB.de wrote:
> 
> use DateTime::Event::Cron;
> 
> $cron = DateTime::Event::Cron->from_cron(cron => ' 15 18 * * 1-5');
> $new_cron = $cron->clone()->set_time_zone('Europe/Berlin');
> 
> $date = DateTime->new( year => 2004, month => 6, day => 30,
>                        hour => 17,   minute=> 10,
>                        time_zone => 'Europe/London');
> 
> print $date->strftime("%a %F %T %Z\n");
# Wed 2004-06-30 17:10:00 GMT/BST

ok

> $date = $date->clone()->set_time_zone('Europe/London');
> 
> print $date->strftime("%a %F %T %Z\n");
# Wed 2004-06-30 17:10:00 GMT/BST

ok

> $next = $new_cron->next($date);
> print $next->strftime("%a %F %T %Z\n");
# was: Wed 2004-06-30 19:15:00 CEST

I got Wed 2004-06-30 17:15:00 GMT/BST, it looks correct now.
This is the local London time, when cron ticks 18:15 in Berlin.

> # Let's repeat the same operation as before
> 
> $date = DateTime->new( year => 2004, month => 6, day => 30,
>                        hour => 17,   minute=> 10,
>                        time_zone => 'Europe/London');
> 
> print $date->strftime("%a %F %T %Z\n");
# Wed 2004-06-30 17:10:00 GMT/BST

ok

> $date = $date->clone()->set_time_zone('Europe/Berlin');
> print $date->strftime("%a %F %T %Z\n");
# Wed 2004-06-30 18:10:00 CEST

ok

> $next = $new_cron->next($date);
> print $next->strftime("%a %F %T %Z\n");
# Wed 2004-06-30 18:15:00 CEST

ok.
This is the local Berlin time, when cron ticks 18:15 in Berlin.
It is the same time as before, but in a different time zone.

- Flavio S. Glock
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic