0

I have a couple of timestamps in ordinal time such as for example 737778.582024. I want to convert it to something understandable, preferrably a datetime object. The number probably contains information down to as small as milliseconds.

In MATLAB there is the function datetime() which will give my expected result:

>> t = datetime(737778.582024,'ConvertFrom','datenum')

t = 

  datetime

   19-Dec-2019 13:58:06

In Python I could only find the function datetime.fromordinal() which only takes integers as input and thus can only convert to a date.

from datetime import  datetime
datetime.fromordinal(737778.582024)

TypeError: integer argument expected, got float

Is there a python function similar to the MATLAB one?

ga97dil
  • 1,139
  • 9
  • 26
  • Does this answer your question? [Converting unix timestamp string to readable date](https://stackoverflow.com/questions/3682748/converting-unix-timestamp-string-to-readable-date) – manuhortet Dec 20 '19 at 13:09
  • 1
    Sadly not. Dont confuse ordinal time with, unix time – ga97dil Dec 20 '19 at 13:10

0 Answers0