Skip to content

Instantly share code, notes, and snippets.

@seungwoonlee
Created April 19, 2019 08:39
Show Gist options
  • Save seungwoonlee/12ec934b542ae24c0e2687e3f68ad456 to your computer and use it in GitHub Desktop.
Save seungwoonlee/12ec934b542ae24c0e2687e3f68ad456 to your computer and use it in GitHub Desktop.
maya 를 사용해서 날짜문자열을 날짜 데이터형으로 변환
import maya # pip install maya 잘 설치가 안되는 듯, 될때까지 반복
str = '2019-04-19 1:50:39 PM'
dt = maya.parse(str).datetime()
print(dt)
print(dt.date())
print(dt.time())
print(dt.tzinfo) # 기본적으로 UTC로 설정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment