[AstroPy] datetime and timestamp

eperez eperez at iaa.es
Thu Oct 14 05:17:42 EDT 2021


I get an inconsistent result when translating datetime to timestamp:
A later date gives a lower timestamp: tehere is a jump backwards:


In : time.mktime(datetime(2021, 3, 28, 2, 40).timetuple())
Out: 1616895600.0

In : time.mktime(datetime(2021, 3, 28, 2, 50).timetuple())
Out: 1616896200.0

In : time.mktime(datetime(2021, 3, 28, 3, 0).timetuple())
Out: 1616893200.0
In : time.mktime(datetime(2021, 3, 28, 3, 10).timetuple())
Out: 1616893800.0


I would very much appreciate your insight.

I am not sure this is the right list to ask; apologies if it isn’t.

Cheers.
ES.Enrique

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20211014/325a0e39/attachment.html>


More information about the AstroPy mailing list