On Thu, Dec 05, 2013 at 06:21:12PM +0000, Zefram wrote:
> If you need a non-zero fixed offset, and must use named zones rather
> than DT:TZ:OffsetOnly, I recommend not worrying about the names.

I don't need named zones, just want to have the offset in a configuration
setting.  From another response I've reduced the usage in my application to:

  my $tzofs = "-0900"; # ... or read from a config file or constant
  my $tztime = DateTime->now(time_zone=>$tzofs)->strftime("%y:%j:%H:%M:%S");

This is clearly described in the manual but I had missed it:

  DateTime->now( ... )
    ... Just as with the new() method, it accepts "time_zone" and
    "locale" parameters.

  DateTime->new( ... )
    ...
    The time_zone parameter can be either a scalar...  A string will
    simply be passed to the DateTime::TimeZone->new method as its "name"
    parameter. This string may be ... an offset string ("+0630")...

Thanks for the help and all the work.

Ken

Reply via email to