Timezone
The timezone setting determines how schedules are evaluated. A 9 AM schedule uses 9 AM in your configured timezone.
Configuration
Section titled “Configuration”In config.json
Section titled “In config.json”{ "settings": { "timezone": "America/New_York" }}Via CLI
Section titled “Via CLI”nextdns-blocker config set timezone America/Los_AngelesAuto-Detection
Section titled “Auto-Detection”During init, timezone is automatically detected:
| Platform | Method |
|---|---|
| macOS | /etc/localtime symlink |
| Linux | /etc/localtime symlink |
| Windows | tzutil /g command |
| Fallback | TZ environment variable |
| Default | UTC |
Common Timezones
Section titled “Common Timezones”United States
Section titled “United States”| City | Timezone |
|---|---|
| New York | America/New_York |
| Chicago | America/Chicago |
| Denver | America/Denver |
| Phoenix | America/Phoenix |
| Los Angeles | America/Los_Angeles |
| Anchorage | America/Anchorage |
| Honolulu | Pacific/Honolulu |
Europe
Section titled “Europe”| City | Timezone |
|---|---|
| London | Europe/London |
| Paris | Europe/Paris |
| Berlin | Europe/Berlin |
| Madrid | Europe/Madrid |
| Rome | Europe/Rome |
| Amsterdam | Europe/Amsterdam |
| Moscow | Europe/Moscow |
Asia/Pacific
Section titled “Asia/Pacific”| City | Timezone |
|---|---|
| Tokyo | Asia/Tokyo |
| Shanghai | Asia/Shanghai |
| Hong Kong | Asia/Hong_Kong |
| Singapore | Asia/Singapore |
| Sydney | Australia/Sydney |
| Auckland | Pacific/Auckland |
| Dubai | Asia/Dubai |
| Mumbai | Asia/Kolkata |
Americas
Section titled “Americas”| City | Timezone |
|---|---|
| Toronto | America/Toronto |
| Vancouver | America/Vancouver |
| Mexico City | America/Mexico_City |
| São Paulo | America/Sao_Paulo |
| Buenos Aires | America/Argentina/Buenos_Aires |
| Zone | Timezone |
|---|---|
| UTC | UTC |
| GMT | Etc/GMT |
IANA Timezone Database
Section titled “IANA Timezone Database”NextDNS Blocker uses IANA timezone names. Full list: List of tz database time zones
Format
Section titled “Format”- Region/City format:
America/New_York - Always use underscores:
New_YorknotNew York - Case sensitive (typically capitalized)
How Timezone Affects Schedules
Section titled “How Timezone Affects Schedules”Example Schedule
Section titled “Example Schedule”{ "schedule": { "available_hours": [ { "days": ["monday"], "time_ranges": [{"start": "09:00", "end": "17:00"}] } ] }}With Different Timezones
Section titled “With Different Timezones”| Timezone | Available At | In UTC |
|---|---|---|
America/New_York | 9 AM - 5 PM ET | 14:00 - 22:00 UTC |
America/Los_Angeles | 9 AM - 5 PM PT | 17:00 - 01:00 UTC |
Europe/London | 9 AM - 5 PM GMT | 09:00 - 17:00 UTC |
Asia/Tokyo | 9 AM - 5 PM JST | 00:00 - 08:00 UTC |
Daylight Saving Time
Section titled “Daylight Saving Time”IANA timezones automatically handle DST:
America/New_Yorkswitches between EST and EDTEurope/Londonswitches between GMT and BST- Schedules adjust automatically
Viewing Current Timezone
Section titled “Viewing Current Timezone”In Status
Section titled “In Status”nextdns-blocker statusShows current time with timezone:
Time: 2024-01-15 14:30:00 America/New_YorkIn Config
Section titled “In Config”nextdns-blocker config show | grep timezoneChanging Timezone
Section titled “Changing Timezone”Method 1: CLI
Section titled “Method 1: CLI”nextdns-blocker config set timezone Europe/LondonMethod 2: Edit Config
Section titled “Method 2: Edit Config”nextdns-blocker config editChange the timezone value and save.
Method 3: Re-run Init
Section titled “Method 3: Re-run Init”nextdns-blocker initRe-detects system timezone.
Multi-Timezone Considerations
Section titled “Multi-Timezone Considerations”Traveling
Section titled “Traveling”When traveling across timezones:
- Keep original timezone - Schedules stay consistent
- Update to local timezone - Schedules adjust to local time
Recommendation: Keep your “home” timezone for consistency.
Remote Work
Section titled “Remote Work”If you work with teams in different timezones:
- Configure for your local timezone
- Adjust schedules to account for meeting times
- Consider using UTC if working globally
Troubleshooting
Section titled “Troubleshooting”Wrong time shown in status
Section titled “Wrong time shown in status”-
Check configured timezone:
Terminal window nextdns-blocker config show | grep timezone -
Verify system timezone:
Terminal window # macOS/Linuxdate# Windowstzutil /g -
Update if mismatched:
Terminal window nextdns-blocker config set timezone America/New_York
Schedule not matching expectations
Section titled “Schedule not matching expectations”-
Check timezone is correct
-
Verify 24-hour time:
- 6 PM =
18:00 - 9 AM =
09:00
- 6 PM =
-
Check day name:
- Use lowercase:
monday - Verify correct day
- Use lowercase:
”Unknown timezone” error
Section titled “”Unknown timezone” error”- Check spelling (case sensitive)
- Use Region/City format
- Consult IANA timezone list
# Validnextdns-blocker config set timezone America/New_York
# Invalidnextdns-blocker config set timezone ESTnextdns-blocker config set timezone Easternnextdns-blocker config set timezone new_yorkDST transition issues
Section titled “DST transition issues”IANA timezones handle DST automatically. If you see issues:
-
Update
tzdatapackage:Terminal window pip install --upgrade tzdata -
Ensure Python 3.9+ (uses zoneinfo)
Technical Details
Section titled “Technical Details”Implementation
Section titled “Implementation”NextDNS Blocker uses Python’s zoneinfo module (Python 3.9+):
from zoneinfo import ZoneInfotz = ZoneInfo("America/New_York")Timezone Data
Section titled “Timezone Data”Timezone data comes from:
- System tzdata on macOS/Linux
tzdataPython package (bundled)
Validation
Section titled “Validation”Valid timezones are checked against the IANA database during:
config set timezoneconfig validateinit