Docs/Python/现在的时间.py
2022-10-18 16:59:37 +08:00

12 lines
No EOL
463 B
Python

import datetime
def getnow():
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
return now
# ——————————————————————————————————————————————————————————————————————————————
import time
def getnow():
now = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
return now