0

is there a logical reason or it's a bug that

datetime.datetime.fromtimestamp(0).timestamp()

raises OSError: [Errno 22] Invalid argument?

I would expect as result 0.0 as I'm passing from timestamp 0 to datetime and again back to timestamp

I'm on Win10 (tested with 3.7, 3.11)

FObersteiner
  • 22,500
  • 8
  • 42
  • 72
user862989
  • 61
  • 1
  • 1
  • 3
  • https://stackoverflow.com/a/54460238/11305029 – droebi Dec 20 '22 at 10:04
  • I only tried "datetime.datetime.fromtimestamp(0)" and it worked for me . It gives me the Unix Timestamp back. What would you like to archive? – Mark Baumann Dec 20 '22 at 10:06
  • This is a platform-specific problem. See also https://stackoverflow.com/q/71680355/10197418 – FObersteiner Dec 20 '22 at 11:04
  • @MauriceMeyer I don't think the dupe you linked is appropriate (outdated Python version, IMHO no satisfying/accepted solution). There are more specific ones like the one I linked in the comment above, or also https://stackoverflow.com/q/59199985/10197418 or https://stackoverflow.com/q/67898530/10197418 – FObersteiner Dec 20 '22 at 11:12

0 Answers0