On Thu, 24 Jun 2004, Flavio S. Glock wrote:

> Matt Sisk wrote:
> >
> > Just to be clear, this is the native behavior of DateTime::Set, rather
> > than something that DateTime::Event::Cron is introducing into the sets
> > it generates. Using your same example, but replacing the cron set with
> > an actual (monthly) recurrence set, we see the same behavior:
> >
>
> That's right - the problem is that the default timezone for
> now() is UTC, even if my TZ is set to another timezone...
>
>   $now = DateTime->now();
>   print $now->strftime( "%a %F %T %Z\n");
>   print $ENV{TZ},"\n";
>   # Thu 2004-06-24 12:54:49 UTC
>   # America/Sao_Paulo

Well, the docs say that now() always returns a UTC time.  The reason being
that getting the local time zone is not always possible, so if we call
time() to get the current local epoch, we may not be able to figure out
the time zone.  But calling gmtime() always works.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to