[Info-vax] EU will abandon daylight savings time in 2021)
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Wed Apr 3 16:02:33 EDT 2019
On 2019-04-03 18:59:53 +0000, Jan-Erik Sderholm said:
> It is transmitted as "Unix epoch" format, no problem with that.
> We can easily subtract 3600 or 7200 from the epoch-number of seconds.
Unix epoch will work for recent values and for apps with minimal
requirements, but it's not the base that I'd choose to use with a new
app. I'd usually pass around the ISO 8601 text in UTC, given the
choice. Yeah, there can be parsing-numerics versus parsing-dates
parsing discussions and there can be discussions of relative
performance here. Maybe those discussions can be later, if the
performance becomes an issue. OpenVMS can deal with the conversions
directly to the specified timezone, and without knowing nor hard-coding
the timezone offsets. So too can Python.
Start here:
https://stackoverflow.com/a/28147286/94997
Related:
https://stackoverflow.com/questions/79797/how-to-convert-local-time-string-to-utc
https://stackoverflow.com/questions/2150739/iso-time-iso-8601-in-python
Also date.isoformat(), date.isoformat(), UTC-related calls, etc.
https://docs.python.org/2/library/datetime.html
Another approach:
https://pythonhosted.org/pytz/
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list