[ Python ] 파이썬 pywin32 날짜 및 시간 또는 국가 불러오기
1. pip 패키지 설치
$ pip install pywin32
2. 설정된 형식 시간 가져오기
import win32api
print(win32api.GetTimeFormat(0, 0, None))
> 오전 11:17:09
3. 서머타임 인 일광 절약 시간 가져오기
import win32api
print(win32api.GetTimeZoneInformation())
> (0, (-540, '대한민국 표준시', (0, 0, 0, 0, 0, 0, 0, 0), 0,
'대한민국 일광 절약 시간', (0, 0, 0, 0, 0, 0, 0, 0), -60))
4. 로컬 시간 불러오기
import win32api
print(win32api.GetLocalTime())
> (2022, 5, 2, 17, 12, 7, 57, 470)
5. 시스템 시간 불러오기
import win32api
print(win32api.GetSystemTime())
> (2022, 5, 2, 17, 3, 7, 57, 471)
==========
댓글
댓글 쓰기