Python DateTIme

Submitted by code_admin on Sat, 01/12/2019 - 12:07

import pytz
import datetime
from dateutil.parser import parse

Get a UTC datetime object from isoformat string

  1.     dt = parse(result2JSON['jwtData']['TokenExpiry'])
  2.     dateTimeObjFromJSON = dt.astimezone(pytz.utc)
  3.     print(dateTimeObjFromJSON)

Tags

RJM Article Type
Quick Reference