mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 09:42:38 -05:00
remove datetime.utcnow()
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import re
|
||||
from datetime import datetime, timezone
|
||||
|
||||
SMS_CHAR_COUNT_LIMIT = 918 # 153 * 6, no network issues but check with providers before upping this further
|
||||
LETTER_MAX_PAGE_COUNT = 10
|
||||
@@ -23,3 +24,15 @@ email_with_smart_quotes_regex = re.compile(
|
||||
# and then later remove when performing tricky formatting operations
|
||||
MAGIC_SEQUENCE = "🇬🇧🐦✉️"
|
||||
magic_sequence_regex = re.compile(MAGIC_SEQUENCE)
|
||||
|
||||
|
||||
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