I just started moving from Matlab to Python 2.7 and I have some trouble reading my .mat-files. Time information is stored in Matlab\'s datenum format. For those who are not
Here's a way to convert these using numpy.datetime64, rather than datetime.
numpy.datetime64
datetime
origin = np.datetime64('0000-01-01', 'D') - np.timedelta64(1, 'D') date = serdate * np.timedelta64(1, 'D') + origin
This works for serdate either a single integer or an integer array.
serdate