utcoffset respects the given date. this is a problem when creating a datetime which is normaltime and currently there is daylight saving time. to fix this we should use the actual date to determine utcoffset.

pull/6/head
Marc Egli 2011-08-26 16:00:41 +02:00
rodzic 6696065a44
commit 7967e02608
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -309,7 +309,7 @@ class vDatetime:
def ical(self):
if self.dt.tzinfo:
utc_time = self.dt - self.dt.tzinfo.utcoffset(datetime.now())
utc_time = self.dt - self.dt.tzinfo.utcoffset(self.dt)
return utc_time.strftime("%Y%m%dT%H%M%SZ")
return self.dt.strftime("%Y%m%dT%H%M%S")