티스토리 뷰

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

'공부' 카테고리의 다른 글

[kotlin] map -> flatMap  (0) 2022.08.11
Spring Webflux + JDBC(혹은 blocking call) 핸들링 방법  (0) 2022.08.11
[JUnit] @Disabled (as-is @Ignore)  (0) 2022.08.11
[Java] map -> properties `putAll`  (0) 2022.08.11
[kotlin] if not in (!in)  (0) 2022.08.11
댓글