Implement C's Switch in Python 3

Chris Angelico rosuav at gmail.com
Sun Feb 3 19:15:53 EST 2019


On Mon, Feb 4, 2019 at 11:08 AM Chris Angelico <rosuav at gmail.com> wrote:
> If you need to attach some *other* time zone (which should be rare -
> ONLY do this if you absolutely cannot translate to UTC)

BTW, there are some legit reasons for keeping something in a different
timezone. If you're representing an instant in time, use UTC; but if
you're representing a recurring event in a civil context, you may want
to say something like "every Thursday at 5pm Europe/Prague". Or if
you're dealing with future events, it might be important to have the
recorded time change if civil time changes. But for event timestamping
("this is when this HTTP request came in"), just convert it to UTC on
arrival and store it with the "Z" suffix.

ChrisA



More information about the Python-list mailing list