mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 23:02:13 -05:00
replace utcnow with timezone naive utc call
This commit is contained in:
14
app/utils.py
14
app/utils.py
@@ -1,4 +1,4 @@
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
from flask import url_for
|
||||
from sqlalchemy import func
|
||||
@@ -132,3 +132,15 @@ def hilite(message):
|
||||
ansi_green = "\033[32m"
|
||||
ansi_reset = "\033[0m"
|
||||
return f"{ansi_green}{message}{ansi_reset}"
|
||||
|
||||
|
||||
def aware_utcnow():
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
|
||||
def naive_utcnow():
|
||||
return aware_utcnow().replace(tzinfo=None)
|
||||
|
||||
|
||||
def utc_now():
|
||||
return naive_utcnow()
|
||||
|
||||
Reference in New Issue
Block a user