<?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: parseDate is not working in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774708#M56528</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/459886"&gt;@AZ_10002894&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly check the following article on parsedate in Thingworx:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.ptc.com/en/support/article/CS219448" target="_blank"&gt;https://www.ptc.com/en/support/article/CS219448&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it doesnt solve your issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bhawna&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 09:18:08 GMT</pubDate>
    <dc:creator>bchaudhary</dc:creator>
    <dc:date>2022-01-26T09:18:08Z</dc:date>
    <item>
      <title>parseDate is not working</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774641#M56521</link>
      <description>&lt;P&gt;Hello, need some help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a service Datetime output(string works) with ""MM/DD/YYYY hh:mm" format, I used dateFormat and parseDate to try to achieve this, but output shows other format, I check with postman, and I looks similar, please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AZ_10002894_0-1643148478687.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/51730i181427285E7B1C28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AZ_10002894_0-1643148478687.png" alt="AZ_10002894_0-1643148478687.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;postman&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AZ_10002894_1-1643148599069.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/51731i980781BADBD0F885/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AZ_10002894_1-1643148599069.png" alt="AZ_10002894_1-1643148599069.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 22:12:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774641#M56521</guid>
      <dc:creator>AZ_10002894</dc:creator>
      <dc:date>2022-01-25T22:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: parseDate is not working</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774708#M56528</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/459886"&gt;@AZ_10002894&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly check the following article on parsedate in Thingworx:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.ptc.com/en/support/article/CS219448" target="_blank"&gt;https://www.ptc.com/en/support/article/CS219448&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it doesnt solve your issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bhawna&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 09:18:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774708#M56528</guid>
      <dc:creator>bchaudhary</dc:creator>
      <dc:date>2022-01-26T09:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: parseDate is not working</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774810#M56546</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Bhawna,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;that was exactly example that I used, just eliminate sdf var, using the string directly in parseString and parseDate.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//Standard ThingWorx Date Format
var sdf = "MM/DD/YYYY hh:mm";

// dateValue:DATETIME
var dateValue = new Date();

// dateFormat(dateValue:DATETIME,dateFormat:STRING):STRING
var formattedDate = dateFormat(dateValue, sdf);

// parseDate(stringDate:STRING,dateFormat:STRING):DATETIME
var result = parseDate(formattedDate, sdf);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but, that doesnot works, at least for me, could you run this code on a thingworx service?, that doesnt change the output format.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 16:37:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774810#M56546</guid>
      <dc:creator>AZ_10002894</dc:creator>
      <dc:date>2022-01-26T16:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: parseDate is not working</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774911#M56563</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/459886"&gt;@AZ_10002894&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;why don't you get the output as string and provide formatted date into output instead of parsing it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// dateFormat(dateValue:DATETIME,dateFormat:STRING):STRING&lt;BR /&gt;var formattedDate = dateFormat(dateValue, sdf);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// parseDate(stringDate:STRING,dateFormat:STRING):DATETIME&lt;BR /&gt;//var result = parseDate(formattedDate, "MM-dd-yyyy HH:MM");&lt;BR /&gt;var result = formattedDate;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pls&amp;nbsp;&lt;SPAN&gt;let me know if you need further assistance on this or if it doesn't meet your use case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Bhawna&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 08:55:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/parseDate-is-not-working/m-p/774911#M56563</guid>
      <dc:creator>bchaudhary</dc:creator>
      <dc:date>2022-01-27T08:55:03Z</dc:date>
    </item>
  </channel>
</rss>

