等级: 超级版主
- 注册:
- 2021-5-24
- 曾用名:
|
对的。
# float类型转为datetime类型
def convert_to_datetime(date):
int_value = int(date)
year = int_value // 10000000000
month = (int_value % 10000000000) // 100000000
day = (int_value % 100000000) // 1000000
hour = (int_value % 1000000) // 10000
minute = (int_value % 10000) // 100
second = int_value % 100
return datetime.datetime(year,month ,day, hour, minute, second)
# float类型转为datetime.time类型
def convert_to_time(date):
int_value = int(data)
hour = (int_value % 1000000) // 10000
minute = (int_value % 10000) // 100
second = int_value % 100
return datetime.time(hour, minute, second) |
|