pip install pytime python from pytime import pytime date_string = "2021-10-01" date = pytime.parse(date_string) print(date) 2021-10-01 00:00:00 python from pytime import pytime date_string = "2021-10-01" date = pytime.parse(date_string) date_string = pytime.to_date(date) print(date_string) 2021-10-01 python from pytime import pytime time_string = "10:30:00" time = pytime.parse(time_string, target='time') print(time) 1900-01-01 10:30:00 python from pytime import pytime time_string = "10:30:00" time = pytime.parse(time_string, target='time') time_string = pytime.to_time(time) print(time_string) 10:30:00 python from pytime import pytime date = pytime.parse(date_string) print(date) 2021-10-01 00:00:00


上一篇:
下一篇:
切换中文