sleep_data / util /date_util.py
thelou1s's picture
draw acc
6b4e7c6
raw
history blame
324 Bytes
from datetime import datetime
def format_date(section_date):
# 使用datetime.strptime解析原始日期字符串
date_obj = datetime.strptime(section_date, "%Y%m%d%H%M")
# 使用strftime将日期对象格式化为新的格式
formatted_date = date_obj.strftime("%Y%m%d %H:%M")
return formatted_date