parse_datetime

class convert2.parse_datetime.Anything2Datetime[source]

Parse anything to datetime.datetime.

The logic:

  • for int, it’s the datetime.from_utctimestamp(value)
  • for float, it’s the datetime.from_utctimestamp(value)
  • for str, try to parse datetime
  • for datetime type, it’s itself
  • for date type, it’s the time at 00:00:00