Skip to content

Commit

Permalink
Replace parse_strtime with parse_isotime in older/newer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jd committed Jun 3, 2015
1 parent f5aa17f commit 421b562
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oslo_utils/timeutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 421b562

Please sign in to comment.