Skip to content

Instantly share code, notes, and snippets.

@sleepless-se
Created January 18, 2018 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sleepless-se/4a8366e630f7281bb816a600543ce497 to your computer and use it in GitHub Desktop.
Save sleepless-se/4a8366e630f7281bb816a600543ce497 to your computer and use it in GitHub Desktop.
you can comvert ISO8601 String to Japan datetime. if you delete line 8 you can use as ISO8601 String converter.
from datetime import date
dt="2017-09-10T07:16:50Z"
import datetime
import dateutil.parser
def toJpDateTimeFromISO8601String(s):
d = dateutil.parser.parse(s)
d = d + datetime.timedelta(hours=9)
return d
print(str(getDateTimeFromISO8601String(dt))[0:19])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment