<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[TZ magic in ESP&#x2F;M5Unified]]></title><description><![CDATA[<p dir="auto">Mt RTC is set to UTC. Somehow, this magically works:</p>
<pre><code>    setenv("TZ","PST8PDT",1);
    tzset();
    auto tm = localtime(&amp;t);
    M5.Display.printf("ESP32 %04d/%02d/%02d (%s)  %02d:%02d:%02d\r\n",
          tm-&gt;tm_year+1900, tm-&gt;tm_mon+1, tm-&gt;tm_mday,
          wd[tm-&gt;tm_wday],
          tm-&gt;tm_hour, tm-&gt;tm_min, tm-&gt;tm_sec);
</code></pre>
<p dir="auto">Just posting here in case someone is mystified by the Rtc.ino example, since it doesn't set the TZ "environment variable" the calls to localtime and gmtime will return the same.</p>
]]></description><link>https://community.m5stack.com/topic/7134/tz-magic-in-esp-m5unified</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 16:18:06 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7134.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Dec 2024 20:37:55 GMT</pubDate><ttl>60</ttl></channel></rss>