Python 현재 시각 얻기

1 개요[ | ]

Python 현재일시 얻기
Python 현재 시각 얻기
파이썬 현재 날짜·시각 얻기
Python
CPU
0.0s
MEM
8M
0.0s
Copy
from datetime import datetime
now = datetime.today().strftime('%Y-%m-%d %H:%M:%S')
print( now ) # 2020-01-15 13:44:21
2022-03-12 06:00:02
Python
Copy
import time
now = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())
print( now ) # 2020-01-15 13:44:21
Loading

2 같이 보기[ | ]