Skip to content

Commit

Permalink
replace iana_tz by iana_tz.zone
Browse files Browse the repository at this point in the history
Because is need a string
  • Loading branch information
PhoenixAlx authored Apr 26, 2018
1 parent bbe1b2c commit edc97a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions O365/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ def get_iana_tz(windows_tz):

def get_windows_tz(self, iana_tz=None):
""" Returns a valid windows TimeZone from a given pytz TimeZone (Iana/Olson Timezones)
Note: Windows Timezones are SHIT!.. no .. really THEY ARE HOLY FUCKING SHIT!
Note: Windows Timezones are SHIT!.. no .. really THEY ARE HOLY FUCKING SHIT!. I AGREE
"""
iana_tz = iana_tz or self.timezone
timezone = IANA_TO_WIN.get(iana_tz.zone if isinstance(iana_tz, tzinfo) else iana_tz)
if timezone is None:
raise pytz.UnknownTimeZoneError("Can't find Iana TimeZone " + iana_tz)
raise pytz.UnknownTimeZoneError("Can't find Iana TimeZone " + iana_tz.zone)

return timezone

Expand Down

0 comments on commit edc97a8

Please sign in to comment.