[Python-Dev] Status on PEP-431 Timezones

Tres Seaver tseaver at palladion.com
Tue Jul 28 03:13:01 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.
- -- 
===================================================================
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)

iQIcBAEBAgAGBQJVttcdAAoJEPKpaDSJE9HYSlEP/0b7A9swT3m0uImdmzSZNJCW
EShQuxkclKlADP0Qqvshbiew1lsdqSPTZQ5QOUnqxeo+F0C1pCSABgFmXA3Jjzon
lxbwOGFFDhBburJ/F5zAO3XnawvL2p/M4dV+3Zea2inO0X+iNUuHvNjwx/e/qR4i
XdC8IyyJZtsFFL+l5KAv7xOT6SaCOB7OrVTZySHrhmfeziClzeBC8GWI00zYIQjj
BYQJB+lLhSBdb3b4u2fqhGtbrFtTHDDHEPC/mWdWAvzJN98YaeOtiTOAqiIg5Xai
TssJwAvonxOy5P8f5XdW03kbaKqmslWVk/0xIT7svjJnfPXVFzHoFJZZAJMEt34s
uZXu79g5ype8gyIJceXZV9/iS6GKHhfUlNTRvemJZb1aiq1QJ26otv2n97yqFbdo
PYfbjSU5EhK7h42138QYCM1JmKmIEIBbb+RN5O5ZaJqWEs1IstaMI1K7rM/Gt9dj
+Du0wV85Vi0ydgrZ2w8z2ZCL3bnl5wW7y8mBiSNWx1OEK7zRn/tq7/+nd9bFi1L0
8KIY8xJn5t0SU+5BSpisxTSAdX8JD6bAPy3wZlNDP8FFfB9zUyCrhRE58cDsvPdO
BQYteyWrpGQJxf2i5UQTLruW2JK3i1lL0en4spucQnBI/eHs7VVHMbfpOpdXhcIl
TR7c9fNwV0kn7EggTajx
=nRMI
-----END PGP SIGNATURE-----



More information about the Python-Dev mailing list