Replace parse_strtime with parse_isotime in older/newer
There's no reason to limit parsing to strtime format as isotime format is better and than parsing isotime also parses strtime formatted strings. Change-Id: I94dc4e9fa08b10139e3ef27fa94e33e0aa124110
This commit is contained in:
parent
f5aa17fe9e
commit
421b562a85
@ -119,7 +119,7 @@ def normalize_time(timestamp):
|
||||
def is_older_than(before, seconds):
|
||||
"""Return True if before is older than seconds."""
|
||||
if isinstance(before, six.string_types):
|
||||
before = parse_strtime(before).replace(tzinfo=None)
|
||||
before = parse_isotime(before).replace(tzinfo=None)
|
||||
else:
|
||||
before = before.replace(tzinfo=None)
|
||||
|
||||
@ -129,7 +129,7 @@ def is_older_than(before, seconds):
|
||||
def is_newer_than(after, seconds):
|
||||
"""Return True if after is newer than seconds."""
|
||||
if isinstance(after, six.string_types):
|
||||
after = parse_strtime(after).replace(tzinfo=None)
|
||||
after = parse_isotime(after).replace(tzinfo=None)
|
||||
else:
|
||||
after = after.replace(tzinfo=None)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user