mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Use system timezone as TIMEZONE setting default
This commit is contained in:
parent
e6535eb6bc
commit
75d8251a29
@ -71,8 +71,10 @@ CHARTS_DISPLAY_TILES = false
|
|||||||
# prevent visitors from mindlessly clicking on those options and hogging your cpu
|
# prevent visitors from mindlessly clicking on those options and hogging your cpu
|
||||||
DISCOURAGE_CPU_HEAVY_STATS = false
|
DISCOURAGE_CPU_HEAVY_STATS = false
|
||||||
|
|
||||||
# offset to UTC
|
# Use system timezone by default. Otherwise specify as either:
|
||||||
TIMEZONE = 0
|
# offset in hours IE 0 = UTC, -5 = EST
|
||||||
|
# IANA time zone IE America/New_York = EST
|
||||||
|
TIMEZONE = None
|
||||||
|
|
||||||
[Fluff]
|
[Fluff]
|
||||||
|
|
||||||
|
@ -6,7 +6,12 @@ from os.path import commonprefix
|
|||||||
import math
|
import math
|
||||||
from doreah.settings import get_settings
|
from doreah.settings import get_settings
|
||||||
|
|
||||||
|
# use system timezone as default
|
||||||
|
# https://stackoverflow.com/a/39079819/1469797
|
||||||
|
TIMEZONE = datetime.datetime.now(datetime.timezone.utc).astimezone().tzinfo
|
||||||
|
# if user specifies a timezone in settings then try to use that instead
|
||||||
OFFSET = get_settings("TIMEZONE")
|
OFFSET = get_settings("TIMEZONE")
|
||||||
|
if OFFSET is not None:
|
||||||
TIMEZONE = timezone(timedelta(hours=OFFSET))
|
TIMEZONE = timezone(timedelta(hours=OFFSET))
|
||||||
|
|
||||||
FIRST_SCROBBLE = int(datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).timestamp())
|
FIRST_SCROBBLE = int(datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).timestamp())
|
||||||
|
Loading…
Reference in New Issue
Block a user