2009/12/14 Kevin McGrath <kmcgr...@baknet.com>

> The time_zone function in DateTime::Format::Strptime is only called with
> parse_datetime.  I think a nice feature would be to also set the time_zone
> when calling format_datetime.
>

Keep in mind that DateTime::Format is a framework, and consistency with
other DT::Format modules is important. All the modules should extract the TZ
information from the given DT object. Setting the TZ on the DT object before
calling the module is the standard behavior.

Whether this is good or not is a wider question. (By the way, I think that
all DT::Format modules should embed the input/output TZ, as this is
formatting information : you usually do not want to make DT calculations in
timezones designed for humans, you usually do not want to print information
for humans using timezones designed for computers).

What you want breaks the current behavior by adding another convenience to a
particular implementation of the interface.
The time_zone option for DT::F::Strptime used for parse_datetime was already
a convenience and is a design error for me. If the string does not gives the
TZ, the returned object should have a floatting TZ.

Olivier.

Reply via email to