新增文章
文章标题
分类
C#
云星空
K3 BOS
K3 功能
用友
Oracle
python
SQL
MySql
PHP
HTML
script
windows
Access
影视后期
财务
服务
生活
内容
import datetime current_datetime = datetime.datetime.now() print("当前日期和时间:", current_datetime) formatted_date = current_datetime.strftime("%Y-%m-%d") print("格式化后的日期:", formatted_date) previous_day = current_datetime - datetime.timedelta(days=1) print("前一天的日期:", previous_day.strftime("%Y-%m-%d")) next_day = current_datetime + datetime.timedelta(days=1) print("后一天的日期:", next_day.strftime("%Y-%m-%d"))
返回
保存