<?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[Parsing of Time in HTTP POST ?]]></title><description><![CDATA[<p dir="auto">I have been using "YYYYMMDDhhmmss" format for date without any problem.</p>
<p dir="auto">Now because the same device should send data to two different Host I have to move to the UTC format (millis seconds from 1, 1, 1970).</p>
<p dir="auto">I experienced bad parsing of the timestamp while the same string is correctly parsed by a Web UTC -&gt; Date string application.</p>
<p dir="auto">Can anyone explain exactly how such timestamp should be formatted for Mango :</p>
<ul>
<li>1231233112</li>
<li>1231233112. (decimal point)</li>
<li>1231233112.000</li>
<li>1231233112.0000</li>
<li>1231233112000 (no decimal point)</li>
</ul>
<p dir="auto">Thanks in advance for your assistance.</p>
<p dir="auto">Pascal</p>
]]></description><link>https://forum.mango-os.com/topic/1959/parsing-of-time-in-http-post</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 01:04:54 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1959.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Sep 2015 07:25:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Thu, 03 Sep 2015 18:09:01 GMT]]></title><description><![CDATA[<p dir="auto">If you still can't make sense of it just send me the strings you used for both formats,  I can check them against my test Mango.</p>
]]></description><link>https://forum.mango-os.com/post/10297</link><guid isPermaLink="true">https://forum.mango-os.com/post/10297</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Thu, 03 Sep 2015 18:09:01 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Thu, 03 Sep 2015 07:43:40 GMT]]></title><description><![CDATA[<p dir="auto">I will check but what looks strange to me is that I tried sending the same date+time in the 2 formats and one was correctly received the other one, with a difference of 1 hour.</p>
]]></description><link>https://forum.mango-os.com/post/10290</link><guid isPermaLink="true">https://forum.mango-os.com/post/10290</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Thu, 03 Sep 2015 07:43:40 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Wed, 02 Sep 2015 22:25:08 GMT]]></title><description><![CDATA[<p dir="auto">pascal,</p>
<p dir="auto">Thanks for the note on the 2032 problem, if you are still using this module in 2032 I'll give you a free enterprise license to Mango with an upgraded module!</p>
<p dir="auto">As for the 1 hour off problem, could it be a timezone problem? Is there a 1hr time difference between where your Mango server is vs where the http request is coming from?  Mango will parse the UTC timestamp into a date using its local timezone.  Then of course there is the User's timezone that will re-convert the timestamps into a Date when viewed through Mango.</p>
<p dir="auto">One way to confirm this would be to check the ts column for the data point in the pointValues table.  It should match exactly what you are sending through.</p>
]]></description><link>https://forum.mango-os.com/post/10276</link><guid isPermaLink="true">https://forum.mango-os.com/post/10276</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Wed, 02 Sep 2015 22:25:08 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Wed, 02 Sep 2015 09:11:44 GMT]]></title><description><![CDATA[<p dir="auto">After testing the updated version, it looks like there is a difference of 1 hour between the time decoded by Mango from "YYYYMMDDHHMMSS" and the UTC timestamp.</p>
<p dir="auto">The first one is correct and the seconde one is 1 hour later ?</p>
<p dir="auto">I have tried both and it is not correct.</p>
<p dir="auto">Any clue ?</p>
]]></description><link>https://forum.mango-os.com/post/10273</link><guid isPermaLink="true">https://forum.mango-os.com/post/10273</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Wed, 02 Sep 2015 09:11:44 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Wed, 02 Sep 2015 07:49:59 GMT]]></title><description><![CDATA[<p dir="auto">Keep in mind that in 2032 the timestamp will start with 1970.... and the decoded year will be &gt; 1970.</p>
<p dir="auto">:-)</p>
]]></description><link>https://forum.mango-os.com/post/10272</link><guid isPermaLink="true">https://forum.mango-os.com/post/10272</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Wed, 02 Sep 2015 07:49:59 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Wed, 02 Sep 2015 07:37:28 GMT]]></title><description><![CDATA[<p dir="auto">Thank you !</p>
]]></description><link>https://forum.mango-os.com/post/10270</link><guid isPermaLink="true">https://forum.mango-os.com/post/10270</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Wed, 02 Sep 2015 07:37:28 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Tue, 01 Sep 2015 22:21:22 GMT]]></title><description><![CDATA[<p dir="auto">pascal,</p>
<p dir="auto">You were using the correct format in your example post: __time=1441120275000</p>
<p dir="auto">I just ran a few tests and did some debugging. I found a bug where the code was first converting the __time parameter via the 'yyyyMMddHHmmss' format, since the timestamp actually does translate into a valid date it was returning this.</p>
<p dir="auto">I have fixed this bug in the 2.6.0 Core and just pushed out a new version of this module for the 2.5.2 core, the new module version is 1.4.8 and you should be able to do an automatic upgrade from the modules page if you are on Core 2.5.2 or later.</p>
<p dir="auto">The new logic will first convert the value using the 'yyyyMMddHHmmss' format and then compare the date.  If the data is before Jan 1 1970 then it will try the other formats.  In your case the proper time is then used.</p>
]]></description><link>https://forum.mango-os.com/post/10267</link><guid isPermaLink="true">https://forum.mango-os.com/post/10267</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Tue, 01 Sep 2015 22:21:22 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Tue, 01 Sep 2015 15:25:45 GMT]]></title><description><![CDATA[<p dir="auto">I tried also adding a decimal point :</p>
<p dir="auto">This is the result (The time displayed is the server time because the 4 successive POSTs sent are "dated" with 1 second delay between each of them instead of 15" as the timestamp sent be the Gateway specifies) :</p>
<p dir="auto">Source: 81.243.242.216<br />
Device ID: PGP_001EC01EF773<br />
Time: 17:19:23<br />
FactorPhB=0.000<br />
FactorPhA=0.980<br />
FactorTotal=0.980<br />
FactorPhC=0.000<br />
WattPhC=0.000<br />
WattPhB=0.000<br />
VoltagePhA=234.000<br />
IndexConsoTf1=30.110<br />
IndexConsoTf2=0.000<br />
VoltagePhC=0.000<br />
VoltagePhB=0.000<br />
WattPhA=1.720<br />
IndexConsoPhC=0.000<br />
IndexConsoPhB=0.000<br />
IndexConsoPhA=30.110<br />
__meter=14100021<br />
IndexProdPhC=0.000<br />
IndexProdTf2=0.000<br />
IndexProdPhB=0.000<br />
IndexProdTf1=0.890<br />
IndexProdPhA=0.890</p>
]]></description><link>https://forum.mango-os.com/post/10265</link><guid isPermaLink="true">https://forum.mango-os.com/post/10265</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Tue, 01 Sep 2015 15:25:45 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Tue, 01 Sep 2015 15:22:28 GMT]]></title><description><![CDATA[<p dir="auto">It sounds like the HTTP receiver is not designed to use a Unix style time.  We can look at this and see if it's something we can add.</p>
]]></description><link>https://forum.mango-os.com/post/10264</link><guid isPermaLink="true">https://forum.mango-os.com/post/10264</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Tue, 01 Sep 2015 15:22:28 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Tue, 01 Sep 2015 15:19:13 GMT]]></title><description><![CDATA[<p dir="auto">In this case Mango hase tried to interpret the timestamp creating a date with 1441 as the year.</p>
]]></description><link>https://forum.mango-os.com/post/10263</link><guid isPermaLink="true">https://forum.mango-os.com/post/10263</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Tue, 01 Sep 2015 15:19:13 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Tue, 01 Sep 2015 15:16:48 GMT]]></title><description><![CDATA[<p dir="auto">It doesn't work that way.</p>
<p dir="auto">Mango is replacing the timestamp with the server one as if there were no timestamp in the POST.</p>
<p dir="auto">When publisher sends data out it looks like the timestamp is like "123245654.1123" with a decimal point (I see that on the</p>
<p dir="auto">This is what I do in the Gateway :</p>
<p dir="auto">Format the number of seconds since Epoch, adding 3 x '0' at the end. :</p>
<p dir="auto">snprintf(WorkBuffer, sizeof(WorkBuffer), "%ld000;", ModbusTimestamp);</p>
<p dir="auto">This the resulting POST contents :</p>
<p dir="auto">POST /httpds HTTP/1.1<br />
HOST: <a href="http://mangolocal.pgpsmartsensing.be" rel="nofollow ugc">mangolocal.pgpsmartsensing.be</a><br />
Content-Type: application/x-www-form-urlencoded<br />
Content-Length: 438</p>
<p dir="auto">__device=PGP_001EC01EF773&amp;__time=1441120275000&amp;__meter=14100021&amp;VoltagePhA=234.200&amp;VoltagePhB=0.000&amp;VoltagePhC=0.000&amp;Frequency=50.010&amp;WattPhA=1.720&amp;WattPhB=0.000&amp;WattPhC=0.000&amp;FactorTotal=0.980&amp;FactorPhA=0.980&amp;FactorPhB=0.000&amp;FactorPhC=0.000&amp;IndexConsoTf1=29.840&amp;IndexConsoTf2=0.000&amp;IndexConsoPhA=29.840&amp;IndexConsoPhB=0.000&amp;IndexConsoPhC=0.000&amp;IndexProdTf1=0.890&amp;IndexProdTf2=0.000&amp;IndexProdPhA=0.890&amp;IndexProdPhB=0.000&amp;IndexProdPhC=0.000</p>
<p dir="auto">This is what is decoded by Mango :</p>
<p dir="auto">Source: 81.243.242.216<br />
Device ID: PGP_001EC01EF773<br />
Time: 1441/12/15<br />
FactorPhB=0.000<br />
FactorPhA=0.980<br />
FactorTotal=0.980<br />
FactorPhC=0.000<br />
WattPhC=0.000<br />
WattPhB=0.000<br />
VoltagePhA=234.500<br />
IndexConsoTf1=29.960<br />
IndexConsoTf2=0.000<br />
VoltagePhC=0.000<br />
VoltagePhB=0.000<br />
WattPhA=1.740<br />
IndexConsoPhC=0.000<br />
IndexConsoPhB=0.000<br />
IndexConsoPhA=29.960<br />
__meter=14100021<br />
IndexProdPhC=0.000<br />
IndexProdTf2=0.000<br />
IndexProdPhB=0.000</p>
]]></description><link>https://forum.mango-os.com/post/10261</link><guid isPermaLink="true">https://forum.mango-os.com/post/10261</guid><dc:creator><![CDATA[pascal]]></dc:creator><pubDate>Tue, 01 Sep 2015 15:16:48 GMT</pubDate></item><item><title><![CDATA[Reply to Parsing of Time in HTTP POST ? on Tue, 01 Sep 2015 14:05:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi Pascal,</p>
<p dir="auto">I've never tried it this way but dates in Mango are generally milliseconds so like 1231233112000 would be the way to represent a Unix type timestamp in Mango.</p>
]]></description><link>https://forum.mango-os.com/post/10259</link><guid isPermaLink="true">https://forum.mango-os.com/post/10259</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Tue, 01 Sep 2015 14:05:34 GMT</pubDate></item></channel></rss>