mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2024-12-22 08:12:44 +00:00
i hate pytz, i hate python2, i hate everything
This commit is contained in:
parent
025e1bf2c7
commit
de1f01b004
1 changed files with 3 additions and 2 deletions
5
service
5
service
|
@ -125,6 +125,7 @@ def main():
|
|||
raw_schedule["conference"]["start"][:10], "%Y-%m-%d"
|
||||
)
|
||||
event_tz = pytz.timezone(raw_schedule["conference"]["time_zone_name"])
|
||||
utc_offset = datetime.now(event_tz).utcoffset().total_seconds()
|
||||
|
||||
for day in raw_schedule["conference"]["days"]:
|
||||
for room in day["rooms"].values():
|
||||
|
@ -135,9 +136,9 @@ def main():
|
|||
d_h, d_m = talk["duration"].split(":")
|
||||
end = start + timedelta(hours=int(d_h), minutes=int(d_m))
|
||||
|
||||
talk["start_ts"] = timegm(start.timetuple())
|
||||
talk["start_ts"] = int(timegm(start.timetuple()) - utc_offset)
|
||||
talk["start_str"] = talk["start"]
|
||||
talk["end_ts"] = timegm(end.timetuple())
|
||||
talk["end_ts"] = int(timegm(end.timetuple()) - utc_offset)
|
||||
talk["locale"] = talk["language"]
|
||||
|
||||
track = None
|
||||
|
|
Loading…
Reference in a new issue