How do I convert a pre-1970 date to epoch in python?

Viewed 152

How do I convert a pre-1970 date to epoch in Python 3.x?

Many examples are given for the oposite direction, where one has a negative epoch value and gets the date by using timedelta. However I cannot find examples where we have the real date time and want to get epoch time stamp.

For example i am doing the following:

timestamp = datetime.datetime(1964, 12, 1, 0, 0).timestamp()

Which gives me "OSError: [Errno 22] Invalid argument"

(The reason I want to do this is to edit the creation date on scanned pictures so that it reflects the time of exposure, in stead of the date of scanning.)

My exact setup: Windows x64 Python 3.7

1 Answers
Related