- Python 86.4%
- Shell 13.6%
| brave-timezone | ||
| .gitignore | ||
| CLAUDE.md | ||
| custom_timezone_ostermundigen_2027.png | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.md | ||
| timezone_diagram.py | ||
| wakeup.py | ||
| wakeup_ostermundigen_2027.png | ||
| wakeup_utc.py | ||
| wakeup_utc_ostermundigen_2027.png | ||
Custom time zone - Ostermundigen (Bern)
Experiments in building a "sunrise-locked" time zone for Dr. Zuber-Strasse 2, 3072 Ostermundigen, that keeps local clock sunrise close to 07:00 so a 30-min-before-sunrise wake-up stays steady through the year.
Scripts
| Script | Output | Description |
|---|---|---|
wakeup.py |
wakeup_ostermundigen_2027.png |
Wake-up time (30 min before sunrise) over the year under normal Swiss time (CET/CEST). |
wakeup_utc.py |
wakeup_utc_ostermundigen_2027.png |
Same wake-up and sunrise times drawn in UTC - a smooth curve with no daylight-saving jumps. |
timezone_diagram.py |
custom_timezone_ostermundigen_2027.png |
A custom zone that holds sunrise near 07:00 using only real UTC offsets, changing on the 1st of each month. |
Diagrams
Wake-up time (local Swiss clock, CET/CEST)
Wake-up time (UTC)
Custom sunrise-locked time zone
The custom zone
Clocks change only on the 1st of a month, using only real, in-use UTC offsets (the fictional half-hour offsets +0:30 / +1:30 / +2:30 are excluded - no country uses them). Result: 8 shifts/year, sunrise held within ±48 min of 07:00.
| Month | Zone | Offset |
|---|---|---|
| Jan-Feb | GMT (Greenwich Mean Time) | UTC+0:00 |
| Mar | CET (Central European Time) | UTC+1:00 |
| Apr | EET (Eastern European Time) | UTC+2:00 |
| May | EAT (East Africa Time) | UTC+3:00 |
| Jun | IRST (Iran Standard Time) | UTC+3:30 |
| Jul-Aug | EAT (East Africa Time) | UTC+3:00 |
| Sep | EET (Eastern European Time) | UTC+2:00 |
| Oct | CET (Central European Time) | UTC+1:00 |
| Nov-Dec | GMT (Greenwich Mean Time) | UTC+0:00 |
The time-shifts (Lord Howe style)
Every shift is on the 1st of a month; the old clock runs to 01:59:59 and then
jumps by the delta, never at midnight:
| Date (1st) | Shift | Clock before | Clock after | New offset |
|---|---|---|---|---|
| March | +1 hour | 01:59:59 | 03:00:00 | UTC+1:00 (CET) |
| April | +1 hour | 01:59:59 | 03:00:00 | UTC+2:00 (EET) |
| May | +1 hour | 01:59:59 | 03:00:00 | UTC+3:00 (EAT) |
| June | +30 min | 01:59:59 | 02:30:00 | UTC+3:30 (IRST) |
| July | -30 min | 01:59:59 | 01:30:00 | UTC+3:00 (EAT) |
| September | -1 hour | 01:59:59 | 01:00:00 | UTC+2:00 (EET) |
| October | -1 hour | 01:59:59 | 01:00:00 | UTC+1:00 (CET) |
| November | -1 hour | 01:59:59 | 01:00:00 | UTC+0:00 (GMT) |
January, February, August and December have no shift (offset unchanged).
Using the zone
The zone is a standard IANA tz
definition: fixed monthly transitions and legal offsets (including the half-hour
UTC+3:30), so zic compiles it to a TZif binary.
Native desktop calendar (the path that works). Linux desktop calendars
(KOrganizer / Kontact, GNOME Calendar) read the system time zone through glibc
(/etc/localtime + /usr/share/zoneinfo), so they honour a custom zone.
Compile the zic source system-wide and select it:
sudo zic -d /usr/share/zoneinfo brave-timezone/ostermundigen.zi
export TZ=Custom/Ostermundigen
# or system-wide: sudo ln -sf /usr/share/zoneinfo/Custom/Ostermundigen /etc/localtime
Browser (optional, and mostly a dead end). brave-timezone/ can make Brave
report the zone via an ICU resource override (written over donor Africa/Algiers,
a real CET/+1 no-DST name, so real Europe/Zurich stays intact). It works at the
browser level, but most hosted web calendars (Proton, Google,
Nextcloud/Framagenda) take their zone from an account/settings list and ignore
the browser, so the custom times rarely surface. Kept for reference.
cd brave-timezone
./build.sh # needs icu-devtools, python3, curl
sudo ./install-brave.sh # patches /opt/brave.com/brave wrapper (Brave only)
sudo ./uninstall-brave.sh # revert
Other platforms: a single zic-compiled TZif also works on per-process macOS and
rooted Android; Windows only via WSL, and iOS not at all (its config profiles can
only select existing IANA zones, not define new ones).
Running
pipenv install
pipenv run python wakeup.py
pipenv run python timezone_diagram.py
Dependencies: astral (sunrise times) and
matplotlib (plotting). Edit YEAR at the top of either script to retarget.


