Skip to content
Snippets Groups Projects
Unverified Commit c77393ed authored by Yan Grange's avatar Yan Grange :wave:
Browse files

Add time zone info

parent cd54b2f7
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@ import subprocess as SP
from ics import Calendar, Event
from datetime import timedelta
from tempfile import mktemp
from sys import argv
import pytz
def main():
date_in = False
......@@ -19,7 +21,11 @@ def main():
date_in = input("agree? ").lower() in ["y", "yes", 1, "true", "ok", "sure", "fine"]
description = input("Description of the meeting: ")
duration = float(input("Duration of the meeting (in hours): "))
default_timezone = pytz.timezone('Europe/Amsterdam')
try:
parsed_date = default_timezone.localize(parsed_date)
except ValueError: # tz already set
pass
evt = Event()
evt.begin = parsed_date.isoformat()
evt.duration = timedelta(hours=duration)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment