<?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[Bug in formatDate]]></title><description><![CDATA[<p dir="auto">Ich versuche die formatDate Funktion zu benutzen.</p>
<p dir="auto">Dabei habe ich ein für mich nicht verständliches Verhalten entdeckt.</p>
<pre><code>var diff =  10*24*60*60*1000; // erwartetes Ergebnis 11.01.1970 
log(formatDate(diff,"DD.MM.YYYY"));

var diff =  11*24*60*60*1000; // erwartetes Ergebnis 12.01.1970 
log(formatDate(diff,"DD.MM.YYYY"));
</code></pre>
<p dir="auto">log file</p>
<pre><code>05:36:24.470	[info]	javascript.0 script.js.common.Test: 11.01.1970
05:36:24.471	[info]	javascript.0 script.js.common.Test: 13.02.2000
</code></pre>
<p dir="auto">Was ich nicht verstehe ist das letzte Datum "13.02.2000".</p>
<p dir="auto">Ich hätte "12.01.1970" erwartet.</p>
<p dir="auto">Mache ich einen Denkfehler oder hat die Funktion noch einen Bug?</p>
]]></description><link>https://forum.iobroker.net/topic/10408/bug-in-formatdate</link><generator>RSS for Node</generator><lastBuildDate>Tue, 05 May 2026 08:21:28 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/10408.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 29 Jan 2018 04:40:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bug in formatDate on Tue, 12 May 2020 05:57:29 GMT]]></title><description><![CDATA[<p dir="auto">Wrong one</p>
]]></description><link>https://forum.iobroker.net/post/430454</link><guid isPermaLink="true">https://forum.iobroker.net/post/430454</guid><dc:creator><![CDATA[Pittini]]></dc:creator><pubDate>Tue, 12 May 2020 05:57:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in formatDate on Mon, 29 Jan 2018 17:36:09 GMT]]></title><description><![CDATA[<p dir="auto">Danke.</p>
<p dir="auto">Etwas seltsames Verhalten.</p>
<p dir="auto">Wenn ich Dich richtig verstehe muss ich, wenn die Zahl größer gleich 946681200 ist, durch 1000 teilen, damit es wieder stimmt.</p>
]]></description><link>https://forum.iobroker.net/post/127291</link><guid isPermaLink="true">https://forum.iobroker.net/post/127291</guid><dc:creator><![CDATA[Marty56]]></dc:creator><pubDate>Mon, 29 Jan 2018 17:36:09 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in formatDate on Mon, 29 Jan 2018 09:49:19 GMT]]></title><description><![CDATA[<p dir="auto">Um die Frage mal zu beantworten …</p>
<p dir="auto">Ja da ist die Dokumentation nicht vollständig. :-)</p>
<p dir="auto">Die Funktion prüft folgendes:</p>
<p dir="auto">1.) Zahl &lt;946681200 dann wird es als "Dauer" angenommen und erlaubt.</p>
<p dir="auto">2.) Sonst wenn Zahl &lt; 946681200000 (&lt;2000.01.01 00:00:00) dann wird angenommen das es eine "alte" Angabe in Sekunden anstelle Millisekunden ist und es wird *1000 genommen. Früher war in ioBroker alles in Sekunden und wurde vor ca. 1-2 Jahren auf ms umgestellt. Daher ist an einigen Stellen noch Kompatibilitätscode drin damit alte Skripte weiterlaufen</p>
<p dir="auto">Das erklärt das verhalten und wäre damit "as designed"</p>
]]></description><link>https://forum.iobroker.net/post/127089</link><guid isPermaLink="true">https://forum.iobroker.net/post/127089</guid><dc:creator><![CDATA[apollon77]]></dc:creator><pubDate>Mon, 29 Jan 2018 09:49:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in formatDate on Mon, 29 Jan 2018 09:40:23 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://github.com/ioBroker/ioBroker.javascript/blob/master/doc/en/javascript.md#formatdate" rel="nofollow ugc">https://github.com/ioBroker/ioBroker.ja … formatdate</a></p>
]]></description><link>https://forum.iobroker.net/post/127082</link><guid isPermaLink="true">https://forum.iobroker.net/post/127082</guid><dc:creator><![CDATA[apollon77]]></dc:creator><pubDate>Mon, 29 Jan 2018 09:40:23 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in formatDate on Mon, 29 Jan 2018 06:45:49 GMT]]></title><description><![CDATA[<p dir="auto">Ah, ok. Konnte keine Info dazu finden, nur eine entspr. geschriebenen Funktionsbaustein.</p>
<p dir="auto">Von unterwegs getippert</p>
]]></description><link>https://forum.iobroker.net/post/127050</link><guid isPermaLink="true">https://forum.iobroker.net/post/127050</guid><dc:creator><![CDATA[eric2905]]></dc:creator><pubDate>Mon, 29 Jan 2018 06:45:49 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in formatDate on Mon, 29 Jan 2018 06:34:33 GMT]]></title><description><![CDATA[<p dir="auto">Ist eine Standardfunktion des JavaScript Adapters.</p>
]]></description><link>https://forum.iobroker.net/post/127046</link><guid isPermaLink="true">https://forum.iobroker.net/post/127046</guid><dc:creator><![CDATA[apollon77]]></dc:creator><pubDate>Mon, 29 Jan 2018 06:34:33 GMT</pubDate></item><item><title><![CDATA[Reply to Bug in formatDate on Mon, 29 Jan 2018 05:00:17 GMT]]></title><description><![CDATA[<p dir="auto">Poste bitte mal die Funktion „formatDate“.</p>
<p dir="auto">Gruß,</p>
<p dir="auto">Eric</p>
]]></description><link>https://forum.iobroker.net/post/127037</link><guid isPermaLink="true">https://forum.iobroker.net/post/127037</guid><dc:creator><![CDATA[eric2905]]></dc:creator><pubDate>Mon, 29 Jan 2018 05:00:17 GMT</pubDate></item></channel></rss>