4 ms·
It is quite common a pattern setting the timezones with setenv("TZ",...) There are alternatives, but rewriting every program is not always an option. These ki
by j16sdiz 3y ago
It is quite common a pattern setting the timezones with setenv("TZ",...)
There are alternatives, but rewriting every program is not always an option.
These kind of rewriting sounds exactly like what OpenBSD would do ..
- woodruffw 3y agoThis is perhaps just my ignorance, but when do you find yourself needing to set the timezone like that? Not in 10+ years of C programming have I ever had to do that.
- masklinn 3y agoI assume doing something on behalf of a remote user and still convinced locales can do a thing other than hurt you.
- fanf2 3y agoI might do that if I am writing a quick-and-dirty program that works with times in multiple time zones and I can’t be bothered to find a library with a better API.
- j16sdiz 3y agoIn most of the time, you just set it on program start and never change. This is quite common for programs that expects UTC. Searching in github, other example are: 1) `jq` parsing datetime 2) systemd , timectl printing status 3) Unit tests 4) Some RDP client update its own timezone with server timezone