mirror of
https://github.com/oxen-io/oxen-observer.git
synced 2023-12-14 09:22:54 +01:00
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:
parent
07182822c8
commit
0c42eb96ca
1 changed files with 3 additions and 2 deletions
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue