BJörn Lindqvist schrieb: >> If you extend the range to 64 bits there's no problem: the first >> should print 32503680000, the second -2208988800. > > I think it should be a ValueError, given that the programmer is very > likely to further use the returned timestamp to for example insert > stuff in a database. Then this operation (the insertion into a database) should give a ValueError. Python conceptually has only a single integer type, and that has no range limitation. Of course, if "conversion to time_t" was an operation in datetime, than this should limit it in the range of time_t (which may or may not have 32 bits). > Unix timestamps are not unambiguously defined for > any years other than 1970 to 2038 imho. As others have said: this is simply not true. It depends on the hardware, Unix explicitly, deliberately, leaves that open to the specific operating system implementation. On a 36-bit hardware, the range will be different. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4