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
|
@ -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,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue