The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

dn PythonList at DancesWithMice.info
Mon Aug 30 21:16:30 EDT 2021


On 31/08/2021 11.07, Dennis Lee Bieber wrote:
> On Sun, 29 Aug 2021 19:49:19 -0700 (PDT), "hongy... at gmail.com"
> <hongyi.zhao at gmail.com> declaimed the following:
...

> 	Might have helped to mention you were in China... To me, CST is North
> America Central Standard Time (and I'd have expected this time of year to
> see CDT - Central Daylight Time)... That led me on a weird meaningless side
> track...
...

> 	I'm in EDT (Eastern Daylight Time) -- so 4 hours behind UTC.


Which is correct?

CST in China
https://www.timeanddate.com/time/zones/cst-china

CST in North America
https://www.timeanddate.com/time/zones/cst

and not to mention Cuba
https://www.timeanddate.com/time/zones/


«Time zones are often represented by alphabetic abbreviations such as
"EST", "WST", and "CST", but these are not part of the international
time and date standard ISO 8601 and their use as sole designator for a
time zone is discouraged. Such designations can be ambiguous; for
example, "CST" can mean China Standard Time (UTC+8), Cuba Standard Time
(UTC−5), and (North American) Central Standard Time (UTC−6), and it is
also a widely used variant of ACST (Australian Central Standard Time,
UTC+9:30). Such designations predate both ISO 8601 and the internet era;
in an earlier era, they were sufficiently unambiguous for many practical
uses within a national context (for example, in railway timetables and
business correspondence), but their ambiguity explains their deprecation
in the internet era, when communications more often cannot rely on
implicit geographic context to supply part of the meaning.»
https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations


This is why ISO8601 uses the ±HH:MM numeric suffix to designate a local
time-zone (cf UTC - or as we used to say in the UK, "GMT", and in the
military, "Zulu").


Most of us know about ISO8601 formatting, even if we think of it as
something like the way Unix-time is expressed, rather than it being an
international standard.

Few are aware that "8601" has been extended to cover less-obvious dates,
times, and durations.

For example, do you know that today is (said to be) "the last day of
winter"? Assuming you, dear reader, are in the northern hemisphere,
indeed are living in a temperate zone (cf the tropics or closer to one
of the poles), you reacted by exclaiming "what!?".

Thus, one of the 8601 "extensions" deals with the idea that climatic
seasons have meaning to locations within a narrow range of latitudes,
and that they are six-month inverses between the earth's hemispheres.

So, you couldn't understand/didn't believe me - yet I am completely correct.
(as always - cough, splutter, snort...)

Welcome to the last day of (what may be) your summer!

These things can be tricky...
-- 
Regards,
=dn


More information about the Python-list mailing list