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

os/date should be able to handle a given timezone. #986

Open
amano-kenji opened this issue Jun 9, 2022 · 3 comments
Open

os/date should be able to handle a given timezone. #986

amano-kenji opened this issue Jun 9, 2022 · 3 comments

Comments

@amano-kenji
Copy link
Contributor

For, example

(os/date (os/time) "America/New_York")
@zevv
Copy link
Contributor

zevv commented May 11, 2023

On POSIX systems this might work for you:

(os/setenv "TZ" "America/New_York")
(os/date (os/time) true)

@CosmicToast
Copy link
Contributor

This is non-trivial while maintaining strict ISO C99 compatibility (or, indeed, strict ISO C-anything compatibility), as it does not specify any way of doing this.
On POSIX, setting TZ is indeed the correct approach though.

@amano-kenji
Copy link
Contributor Author

@zevv I think os/date should document TZ environment variable, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants