diff --git a/Command.py b/Command.py index 60bd3cd..4d80ec2 100644 --- a/Command.py +++ b/Command.py @@ -43,9 +43,10 @@ class Command: m = re.match('^(?:(\d{4})[-/])?(\d{1,2})[-/](\d{1,2}),(.*)$', timespec) if m is not None: # a date was given - if m.group(1) != '': - the_time = the_time.replace(year = m.group(1)) - the_time = the_time.replace(month = m.group(2), day = m.group(3)) + if m.group(1) is not None: + the_time = the_time.replace(year = int(m.group(1))) + the_time = the_time.replace(month = int(m.group(2)), + day = int(m.group(3))) timespec = m.group(4) m = re.match('^(\d{1,2}):?(\d{2})?(am?|pm?)?$', timespec, re.I) if m is not None: