<?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[machine.RTC().datetime parameters]]></title><description><![CDATA[<p dir="auto">According to the micropython documentation, the parameters to setting the clock should be<br />
(year, month,day, hour,minute, second, millisecond, tzinfo)<br />
but if I feed them in that order, the date isn't set right.</p>
<p dir="auto">I am using an Atom Matrix.</p>
<p dir="auto">Here is an example of one way that fails, and one that works</p>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">machine.RTC().datetime((2020,12,1,10,20,30,0,0))<br />
(2020, 12, 1, 20, 30, 0, 1, 336)<br />
machine.RTC().datetime()<br />
(2020, 12, 1, 1, 20, 30, 17, 239019)<br />
machine.RTC().datetime((2020,12,1,0,10,20,30,0))<br />
(2020, 12, 1, 10, 20, 30, 1, 336)<br />
machine.RTC().datetime()<br />
(2020, 12, 1, 1, 10, 20, 32, 759064)</p>
</blockquote>
</blockquote>
</blockquote>
<p dir="auto">The first example is how the docs say.<br />
The second example puts a zero in front of the hour, and removes one from the end (to keep it to 8 parameters)</p>
]]></description><link>https://community.m5stack.com/topic/2540/machine-rtc-datetime-parameters</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 15:00:13 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2540.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Dec 2020 21:27:41 GMT</pubDate><ttl>60</ttl></channel></rss>