I want to calculate the timestamps at different times. On the linux server, I call the package time that comes with python, but the timestamps of 2:00 a.m. on April 15, 1990 and 3:00 a.m. on April 15, 1990 are the same Yes, I want to ask if it is the problem of the python package itself, thank you
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.mktime(time.strptime(str('1990-04-15 02:00:00'), '%Y-%m-%d %H:%M:%S'))
640141200.0
>>> time.mktime(time.strptime(str('1990-04-15 03:00:00'), '%Y-%m-%d %H:%M:%S'))
640144800.0
>>>
This seems likely to be related to your time zone; was that a “spring forward” time in your area? Can you reproduce the result if you start Python with TZ=Etc/UTC python3.6?