pyCharm 에서 날짜-시계 사용하기

ArecaCoco·2022년 3월 7일
0

기본 라이브러리로 별도의 설치 없이 사용할 수 있는 날짜와 시간

from datetime import datetime

today = datetime.now()
mytime = today.strftime('%Y-%m-%d-%H-%M-%S')
mydate = today.strftime('%Y-%m-%d')

today 형식 : 2022-03-07 23:54:35.699054
mytime 형식 : 2022-03-07-23-55-25

이런 식이다. 다양하게 활용 가능하다.

profile
밝은냉정함

0개의 댓글