Tim m�ller-Seydlitz wrote:
> In my opinion this should give 18:15:00 GMT/BST
> whatever the time_zone of now is. (As long as it
> is less than or equal to a +/- 12 hours shift)

This is discussed here:

  http://datetime.perl.org/developer/event.html

> Could you please explain this to me?

It looks like it is a bug. Consider this:


$cron = DateTime::Event::Cron->from_cron(cron => '15
18 * * 1-5');

$now = DateTime->now();
$next = $cron->next($now);
print $next->strftime( "%a %F %T %Z\n");
# Thu 2004-06-24 18:15:00 UTC
# but it should be floating time

$cron = $cron->set_time_zone('Europe/London');

$now = DateTime->now();
$next = $cron->next($now);
print $next->strftime( "%a %F %T %Z\n");
# Thu 2004-06-24 19:15:00 GMT/BST
# because it converted UTC=>BST,
# instead of float=>BST

$now = DateTime->now(time_zone => 'Europe/Berlin');
$next = $cron->next($now);
print $next->strftime( "%a %F %T %Z\n");
# Thu 2004-06-24 17:15:00 GMT/BST
# but it should be CEST


- Flavio S. Glock


Reply via email to