Esempio n. 1
0
 def adjust_for_tz(cls, utc_datetime, place_timezone):
   tz = timezone(place_timezone or 'UTC')
   date, time = utc_datetime.split('T')
   time, offset = time.split("-")
   y,m,d,h,mi,s = [int(n) for n in date.split('-') + time.split(':')]
   datetime_utc = datetime(y, m, d, h, mi, s, 0, tzinfo=utils.external.pytz.utc)
   datetime_tz  = datetime_utc.astimezone(tz)
   return datetime_tz.strftime(cls.FORMAT)
Esempio n. 2
0
 def parse_time(cls, cap_datetime, place_timezone):
   tz = timezone(place_timezone or 'UTC')
   date, time   = cap_datetime.split('T')
   time, offset = time.split("-")
   y,m,d,h,mi,s = [int(n) for n in date.split('-') + time.split(':')]
   return datetime(y, m, d, h, mi, s, 0, tzinfo=tz).strftime(cls.FORMAT)