Skip to content

feat: Add configurable timezone support via TZ environment variable#23

Open
andreas-vester wants to merge 1 commit intomainfrom
add_tz_22
Open

feat: Add configurable timezone support via TZ environment variable#23
andreas-vester wants to merge 1 commit intomainfrom
add_tz_22

Conversation

@andreas-vester
Copy link
Copy Markdown
Owner

Implement timezone-aware timestamp handling to fix issue where timestamps were displayed in UTC instead of the configured local timezone. The system now uses the standard Unix TZ environment variable for configuration.

Changes:

  • Added 'tz' configuration field to Settings class (defaults to Europe/Berlin)
  • Updated format_datetime_for_email() to use configured timezone
  • Updated vote timestamp recording to capture time in configured timezone
  • Added comprehensive parametrized unit tests for multiple timezones:
    • Europe/Berlin, Europe/London, America/New_York, Asia/Tokyo, UTC
  • Update .env and .env.example with TZ configuration documentation

Fixes issue where Docker container timestamps were displayed in UTC instead of configured local timezone, causing timestamps in emails and archive to be several hours off.

Default timezone is Europe/Berlin, but users can now configure any IANA timezone by setting the TZ environment variable in their .env file.

Test coverage:

  • 89 tests passing (8 new parametrized timezone tests)
  • All lint and type checks passing

Closes #22

Implement timezone-aware timestamp handling to fix issue where timestamps
were displayed in UTC instead of the configured local timezone. The system
now uses the standard Unix TZ environment variable for configuration.

Changes:
- Added 'tz' configuration field to Settings class (defaults to Europe/Berlin)
- Updated format_datetime_for_email() to use configured timezone
- Updated vote timestamp recording to capture time in configured timezone
- Added comprehensive parametrized unit tests for multiple timezones:
  - Europe/Berlin, Europe/London, America/New_York, Asia/Tokyo, UTC
- Update .env and .env.example with TZ configuration documentation

Fixes issue where Docker container timestamps were displayed in UTC instead of
configured local timezone, causing timestamps in emails and archive to be
several hours off.

Default timezone is Europe/Berlin, but users can now configure any IANA
timezone by setting the TZ environment variable in their .env file.

Test coverage:
- 89 tests passing (8 new parametrized timezone tests)
- All lint and type checks passing

Closes #22
@andreas-vester andreas-vester self-assigned this Jan 29, 2026
@andreas-vester andreas-vester added the enhancement New feature or request label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Timezone handling in Docker container - timestamps show UTC instead of local timezone

1 participant