Unix Time Stamp → datetime Stamp
from datetime import datetime
unixTimestamp = '1576118093'
print(datetime.fromtimestamp(int(unixTimestamp)))
----------------------------------------------------
2019-12-12 11:34:53
datetime Stamp → Unix Time Stamp
from datetime import datetime
import time
today = datetime.today()
print('UNIX Time : %s' %(time.mktime(today.timetuple())))
----------------------------------------------------
UNIX Time : 1646568137.0
'Python > Python Programming' 카테고리의 다른 글
[Python] Check the capacity of the mariadb table using pymysql (0) | 2020.02.06 |
---|---|
[ Python ] 네이버_API 이용하기 (0) | 2020.01.21 |
[Python] BeautifulSoup의 find와 findAll의 차이 (0) | 2020.01.15 |
[Python] 파이썬을 이용하여 텔레그램(Telegram) 메세지 보내기 (0) | 2020.01.09 |
[Python] Monodb Connection Using pymongo. (파이썬을 이용한 몽고DB 이용) (0) | 2019.11.06 |
[Python] Integer maximum value. (정수 자료형 범위) (0) | 2019.11.01 |
[Python] reduce 함수 (0) | 2019.10.24 |
[Python] dateutil 모듈을 이용한 전년,전월,전일,D-day 날짜 구하기 (0) | 2019.10.21 |