Fetching datetime from float in Python

前端 未结 5 1924
天涯浪人
天涯浪人 2020-11-28 09:29

How does one get a datetime from a float in Python?

For e.g, I have a float such as 43111.0 and I want to get the datetime for

5条回答
  •  暖寄归人
    2020-11-28 10:10

    Here is another way

    from pyxlsb import convert_date
    convert_date(value)
    

    You can use

    format(convert_date(value), '%m/%d/%Y')
    

    if you want to format it.

提交回复
热议问题