Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for TZ #660

Merged
merged 1 commit into from
Jan 9, 2025
Merged

add support for TZ #660

merged 1 commit into from
Jan 9, 2025

Conversation

Arlind-dev
Copy link
Contributor

@Arlind-dev Arlind-dev commented Jan 9, 2025

This PR adds the tzdata package, allowing you to set your Timezone using the TZ variable.

It fixed my Timezone issues (tested this locally), but feel free to close if there's a better solution, that I'm not aware of.

@diced
Copy link
Owner

diced commented Jan 9, 2025

Is tzdata needed? In my experience, setting the timezone on linux machines has been something like: ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime (links a timezone in /usr/share/zoneinfo to /etc/localtime). If alpine doesn't include these, I guess we can add tzdata and if it also works with setting the TZ variable thats also convenient.

Copy link
Owner

@diced diced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess it does work, with a quick test below:

docker run --env='TZ=America/Los_Angeles' -it alpine sh -c 'apk add --no-cache tzdata && date'

fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.21/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tzdata (2024b-r1)
OK: 7 MiB in 16 packages
Thu Jan  9 12:01:10 PST 2025

without tzdata it goes to utc:

docker run --env='TZ=America/Los_Angeles' -it alpine date

Thu Jan  9 20:02:19 UTC 2025

@diced diced merged commit 9d7f291 into diced:v4 Jan 9, 2025
6 checks passed
@diced diced added the v4 v4 bugs label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v4 v4 bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants