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
1 changed files with 3 additions and 2 deletions

View File

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