📄Python datetime
1. datetime模块:Python的datetime模块提供了多种类别,用于表示、操作和格式化日期和时间,包括获取当前日期和时间。
📄Python strftime()
1. 时间格式化:Python中的strftime()方法允许将datetime对象转换为不同的字符串格式。
📄Python strptime()
1. 字符串转换为datetime对象:Python的strptime()方法可以将特定格式的字符串转换为datetime对象,例如 "21 June, 2018"。
📄Python获取当前日期时间
1. 获取今日日期:使用date.today()从Python的datetime模块获取当前本地日期。