I have to convert a MATLAB's datenum to Python's datetime.
The following code is as below:
import datetime
matlab_datenum = 63650571169.50261
python_datetime = datetime.date.fromordinal(int(matlab_datenum)) + \
datetime.timedelta(days=matlab_datenum%1) - datetime.timedelta(days=366)
print(matlab_datenum)
The above code generates this error:
OverflowError: Python int too large to convert to C long
How, can I resolve this problem?
63650571169.50261this number seems to big to be a MATLAB datenum first of all, MATLAB datenums are number of days from January 0, 0000, this number is equivalent to 174385126 years. Is this the time when aliens are going to make contact ? The overflow issue could be related to this