cmdlib.py: Don't stringify non-UTC dates
Now that `rfc3339_time()` can take an optional datetime object, we need
to make sure that it's actually in UTC. Otherwise, the `Z` in that
string is a lie.
@@ -38,6 +38,10 @@ def fatal(msg):
def rfc3339_time(t=None):
if t is None:
t = datetime.utcnow()
+ else:
+ # if the need arises, we can convert to UTC, but let's just enforce
+ # this doesn't slip by for now
+ assert t.tzname() == 'UTC', "Timestamp must be in UTC format"
return t.strftime("%Y-%m-%dT%H:%M:%SZ")
