On Oct 14, 2017, at 10:44 AM, Thomas Jollans <t...@tjol.eu> wrote: > >> On 14/10/17 19:34, Stefan Ram wrote: >> r...@zedat.fu-berlin.de (Stefan Ram) writes: >>> a post. Use whatever is appropriate in the special case >>> given, or - to write a general library -, learn the design >>> of a good existing library, like Time4J, first. >> >> Though in many cases, an ISO 8601 time string >> represented by a (named )Python tuple should >> be sufficient for a time stamp. >> >> E.g., ( year, month, day, hour, minute, seconds, >> zone_offset ). >> > > Python provides a datetime (also: date, time, timedelta) type. Use it. > > https://docs.python.org/3/library/datetime.html > > When working with time zones, the standard library needs a little help. > Luckily, there's a module for that. https://pypi.python.org/pypi/pytz > > -- Thomas > -- > https://mail.python.org/mailman/listinfo/python-list
I wrote a blog post about muddling through the timestamp problem, showing examples for datetime, slice-and-dice text, and pytz. Since I was dealing with time zone-specific timestamps, I went with pytz in the end. https://www.kickingthebitbucket.com/2017/04/04/the-python-time-zone-rabbit-hole/ Chris R. -- https://mail.python.org/mailman/listinfo/python-list