diff --git a/calsocial/models.py b/calsocial/models.py index 3a813e9..2975732 100644 --- a/calsocial/models.py +++ b/calsocial/models.py @@ -110,10 +110,12 @@ class Event(db.Model): #: The description of the event description = db.Column(db.UnicodeText()) - def __as_tz(self, timestamp): - from pytz import timezone, utc + def __as_tz(self, timestamp, as_timezone=None): + from pytz import timezone, UTC - return utc.localize(timestamp).astimezone(timezone(self.time_zone)) + utc_timestamp = UTC.localize(timestamp) + + return utc_timestamp.astimezone(as_timezone or timezone(self.time_zone)) @property def start_time_tz(self):