diff options
Diffstat (limited to 'scripts/rpki/sundial.py')
-rw-r--r-- | scripts/rpki/sundial.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/rpki/sundial.py b/scripts/rpki/sundial.py index c8e977c6..0703ff22 100644 --- a/scripts/rpki/sundial.py +++ b/scripts/rpki/sundial.py @@ -105,6 +105,14 @@ class datetime(pydatetime.datetime): """Convert to SQL storage format.""" return self + def later(self, other): + """Return the later of two timestamps.""" + return other if other > self else self + + def earlier(self, other): + """Return the earlier of two timestamps.""" + return other if other < self else self + # Alias to simplify imports for callers timedelta = pydatetime.timedelta |