This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test by running the following in a UNIX shell: | |
# for tz in 'Pacific/Samoa' 'America/Los_Angeles' 'Etc/UTC' 'Asia/Shanghai' 'Pacific/Kiritimati'; do; echo \\n$tz; env TZ=$tz python deciday.py; done; | |
from datetime import datetime, timezone | |
import time | |
utc = datetime.now(timezone.utc) | |
mid = utc.replace(hour=0, minute=0, second=0, microsecond=0) | |
seconds_since_midnight = (utc - mid).total_seconds() | |
deciday = seconds_since_midnight / 8640 | |
offset = round(time.timezone / 8640) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// test by running the following in a UNIX shell: | |
// for tz in 'Pacific/Samoa' 'America/Los_Angeles' 'Etc/UTC' 'Asia/Shanghai' 'Pacific/Kiritimati'; do; echo \\n$tz; env TZ=$tz node deciday.js; done; | |
const now = new Date(), | |
year = now.getUTCFullYear(), | |
month = now.getUTCMonth(), | |
day = now.getUTCDate(), | |
hour = now.getUTCHours(), | |
minute = now.getUTCMinutes(), | |
second = now.getUTCSeconds(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generated Jun 21, 2023 11:02:04 | |
system MacOS 12.6.6 Darwin 21.6.0 x86_64 | |
emacs 28.2 ~/.config/emacs/ | |
doom 3.0.0-pre PROFILE=_@0 grafted, HEAD -> master, origin/master, | |
origin/HEAD 07fca78 2023-05-30 19:39:04 -0400 ~/.config/doom/ | |
shell /usr/local/bin/zsh | |
features ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE PDUMPER THREADS | |
ZLIB | |
traits batch envvar-file | |
modules :config use-package :completion company vertico :ui doom |