python日期与字符串互转
2021-06-17 19:03
标签:https str csdn pretty ring name source ftime word 1str -> date 2date -> str --------------------- 本文来自 criller 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/criller/article/details/73715057?utm_source=copy PS:若时间格式为前段传回,有可能字符串后面有空格,会报错。可len()查看处理 python日期与字符串互转 标签:https str csdn pretty ring name source ftime word 原文地址:https://www.cnblogs.com/wrxblog/p/9719881.htmlimport datetime
detester = ‘2017-01-01‘
date = datetime.datetime.strptime(detester,’%Y-%m-%d‘)
import datetime
date = datetime.now()
detester = date.strftime(‘%Y-%m-%d‘)
下一篇:Spring boot传统部署