<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error parseDate - Invalid format: &amp;quot;1488722317000&amp;quot; is malformed at &amp;quot;7000&amp;quot; in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Error-parseDate-Invalid-format-quot-1488722317000-quot-is/m-p/517221#M13164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.thingworx.com/u1/7529"&gt;Assaf Elgov&lt;/A&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try using the ThingWorx inbuilt function &lt;STRONG&gt;dateFormat&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14887744399601377 jive_macro_code jive_text_macro" jivemacro_uid="_14887744399601377"&gt;&lt;P style="font-size: 13.3333px;"&gt;// dateValue:DATETIME&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;var dateValue = new Date();&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;// dateFormat(dateValue:DATETIME,dateFormat:STRING):STRING&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;var formattedDate = dateFormat(dateValue, "yyyy-MM-dd HH:mm:ss.SSS");&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked fine for me.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/4530_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Do let me know if you still face any issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2017 04:28:55 GMT</pubDate>
    <dc:creator>ankigupta</dc:creator>
    <dc:date>2017-03-06T04:28:55Z</dc:date>
    <item>
      <title>Error parseDate - Invalid format: "1488722317000" is malformed at "7000"</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Error-parseDate-Invalid-format-quot-1488722317000-quot-is/m-p/517220#M13163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what went wrong but I'm trying to do something very simple.&lt;/P&gt;&lt;P&gt;I have infotable with DateTime column, I want to run over it and parse the date.&lt;/P&gt;&lt;P&gt;I get an error for the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var tableLength = result.rows.length;&lt;/P&gt;&lt;P&gt;for (var x = 0; x &amp;lt; tableLength; x++) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var row = result.rows&lt;X&gt;;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //"yyyy-MM-dd HH:mm:ss.SSS";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var dateFormat = Resources["RuntimeLocalizationFunctions"].GetEffectiveToken({token: "dateTimeFormat"});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;var dateValue = parseDate(&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;row.DateTime&lt;/STRONG&gt;&lt;/SPAN&gt;, dateFormat);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried to do toString to row.DateTime and it didn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Mar 2017 14:16:53 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Error-parseDate-Invalid-format-quot-1488722317000-quot-is/m-p/517220#M13163</guid>
      <dc:creator>aelgov</dc:creator>
      <dc:date>2017-03-05T14:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error parseDate - Invalid format: "1488722317000" is malformed at "7000"</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Error-parseDate-Invalid-format-quot-1488722317000-quot-is/m-p/517221#M13164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.thingworx.com/u1/7529"&gt;Assaf Elgov&lt;/A&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try using the ThingWorx inbuilt function &lt;STRONG&gt;dateFormat&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="_jivemacro_uid_14887744399601377 jive_macro_code jive_text_macro" jivemacro_uid="_14887744399601377"&gt;&lt;P style="font-size: 13.3333px;"&gt;// dateValue:DATETIME&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;var dateValue = new Date();&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;// dateFormat(dateValue:DATETIME,dateFormat:STRING):STRING&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;var formattedDate = dateFormat(dateValue, "yyyy-MM-dd HH:mm:ss.SSS");&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked fine for me.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/4530_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Do let me know if you still face any issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 04:28:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Error-parseDate-Invalid-format-quot-1488722317000-quot-is/m-p/517221#M13164</guid>
      <dc:creator>ankigupta</dc:creator>
      <dc:date>2017-03-06T04:28:55Z</dc:date>
    </item>
  </channel>
</rss>

