티스토리 뷰

728x90
import time
ts = time.time()

print(ts) # 1594819641.9622827
import datetime;
  
ct = datetime.datetime.now()
print(ct) # 2020-07-15 14:30:26.159446
  
ts = ct.timestamp()
print(ts) # 1594823426.159446
import time;
  
gmt = time.gmtime()
print(gmt) # time.struct_time(tm_year=2020, tm_mon=7, tm_mday=15, tm_hour=19, tm_min=21, tm_sec=6, tm_wday=2, tm_yday=197, tm_isdst=0)

https://www.geeksforgeeks.org/get-current-timestamp-using-python/

 

Get current timestamp using Python - GeeksforGeeks

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

www.geeksforgeeks.org

 

728x90
댓글