mirror of https://github.com/midoks/mdserver-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
351 B
20 lines
351 B
3 months ago
|
import time
|
||
|
|
||
|
from datetime import datetime
|
||
|
china_datetime = datetime.now()
|
||
|
print(china_datetime)
|
||
|
|
||
|
|
||
|
# date()
|
||
|
tt = time.time() - 180 * 86400
|
||
|
|
||
|
# print(date("%Y-%m-%d", time.time()))
|
||
|
# t = datetime.strptime(str(time.time() - 180 * 86400), "%Y-%m-%d")
|
||
|
# print(t)
|
||
|
|
||
|
|
||
|
d = datetime.fromtimestamp(tt)
|
||
|
# 精确到毫秒
|
||
|
str1 = d.strftime("%Y-%m-%d")
|
||
|
print(str1)
|