Avoid Python's stupidly named "utcnow" function

The function returns a timezone-adjusted value and thus appears to have
absolutely nothing to do with UTC.  Thanks Python.

I think perhaps the function must have been a typo for "utcnot" because
the function specifically returns something that is *not* UTC.
This commit is contained in:
Jason Rhinelander 2022-07-02 20:19:24 -03:00
parent 07182822c8
commit 0c42eb96ca

View file

@ -250,11 +250,12 @@ def parse_mempool(mempool_future):
@app.context_processor
def template_globals():
now = datetime.now(timezone.utc)
return {
'config': conf,
'server': {
'datetime': datetime.now(timezone.utc),
'timestamp': datetime.utcnow().timestamp(),
'datetime': now,
'timestamp': now.timestamp(),
'revision': git_rev,
},
}