janet
janet copied to clipboard
os/date should be able to handle a given timezone.
For, example
(os/date (os/time) "America/New_York")
On POSIX systems this might work for you:
(os/setenv "TZ" "America/New_York")
(os/date (os/time) true)
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.
@zevv I think os/date
should document TZ
environment variable, then.