Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does localtime() return times in UTC even when I have my timezone set?

Return times timezone UTC
0
Posted

Why does localtime() return times in UTC even when I have my timezone set?

0

The uClibc time functions get timezone information from the TZ environment variable, as described in the Single Unix Specification Version 3. See http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html for details on valid settings of TZ. For some additional examples, read http://www.uclibc.org/lists/uclibc/2002-August/004010.html in the uClibc mailing list archive. You can store the value of TZ in the file ‘/etc/TZ’ and uClibc will then automagically use the specified setting.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.