2022-07-26 21:48:50 +02:00
|
|
|
import datetime
|
2022-07-23 20:35:42 +02:00
|
|
|
import zoneinfo
|
|
|
|
|
2022-07-26 21:48:50 +02:00
|
|
|
__all__ = ["LOCAL_TIMEZONE", "today_only_date"]
|
2022-07-23 20:35:42 +02:00
|
|
|
|
|
|
|
LOCAL_TIMEZONE = zoneinfo.ZoneInfo("Europe/Brussels")
|
2022-07-26 21:48:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
def today_only_date() -> datetime.datetime:
|
2022-07-30 18:27:58 +02:00
|
|
|
"""Mongo can't handle datetime.date, so we need a datetime instance
|
2022-07-26 21:48:50 +02:00
|
|
|
|
|
|
|
We do, however, only care about the date, so remove all the rest
|
|
|
|
"""
|
2022-07-30 18:27:58 +02:00
|
|
|
today = datetime.date.today()
|
|
|
|
return datetime.datetime(year=today.year, month=today.month, day=today.day)
|