[Python-Dev] Status on PEP-431 Timezones
tseaver at palladion.com
Tue Jul 28 03:13:01 CEST 2015
-----BEGIN PGP SIGNED MESSAGE-----
On 07/27/2015 06:11 PM, Ronald Oussoren wrote:
> Treating time as UTC with conversions at the application edge might
> be "cleaner" in some sense, but can make code harder to read for
> application domain experts.
> It might be nice to have time zone aware datetime objects with the
> right(TM) semantics, but those can and should not replace the naive
> objects we know and love.
Interesting. My experience is exactly the opposite: the datetimes which
"application domain experts" cared about *always* needed to be non-naive
(zone captured explicitly or from the user's machine and converted to
UTC/GMT for storage). As with encoded bytes, allowing a naive instance
inside the borders the system was always a time-bomb bug (stuff would
blow up at a point far removed from which it was introduced).
The instances which could have safely been naive were all
logging-related, where the zone was implied by the system's timezone
(nearly always UTC). I guess the difference is that I'm usually writing
apps whose users can't be presumed to be in any one timezone. Even in
those cases, having the logged datetimes be incomparable to user-facing
ones would make them less useful.
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the Python-Dev