<?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: JSON to Collection Weid Dates Issue in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53846#M8461</link>
    <description>The issue isn't with the JSON parser, rather it is because the results are being outputted as a datetime value. For testing purposes, I modified the JSON To Collection stage to output as text instead of date, which returns the expected GMT date. However, when that value is outputted as a DateTime, it gets converted to your local timezone. &lt;BR /&gt;&lt;BR /&gt;Since you're in the UK, your timezone follows daylight savings whereas GMT does not, that is when you're seeing the hour difference. For me personally, it's a difference of several hours since I'm on CST.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nicholas Zejdlik&lt;BR /&gt;RPA Developer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 20 Jan 2020 15:01:00 GMT</pubDate>
    <dc:creator>NicholasZejdlik</dc:creator>
    <dc:date>2020-01-20T15:01:00Z</dc:date>
    <item>
      <title>JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53844#M8459</link>
      <description>​​Hi &lt;BR /&gt;&lt;BR /&gt;So we have come across a strange issue with JSON to Collection action&amp;nbsp;not formatting some date/times correctly - date format is I believe called epoch (example of our date string being... \/Date(1555372800000)\/)&lt;BR /&gt;&lt;BR /&gt;Once we convert our string into a collection using the above, some dates are&amp;nbsp;being formatted as&amp;nbsp; 1 day in the past with a time of 23:00. The dates being correctly formatted have time of 00:00. Weirdly it seems to be based on Month - November to March&amp;nbsp;show correct date with time 00:00, April to October are wrong showing&amp;nbsp;date-1 and time 23:00.&lt;BR /&gt;&lt;BR /&gt;Using the above example through an online checker (epochconverter.com) shows GMT date as 16 April 2019 00:00:00.&amp;nbsp;This string runs through the JSON to collection and date that comes out is 15 April 2019 23:00:00&lt;BR /&gt;&lt;BR /&gt;Note this is Version 6.4&lt;BR /&gt;&lt;BR /&gt;Has anyone come across this? or have any ideas on where to&amp;nbsp;start looking to address?&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;hope to hear back&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Adam Ollerenshaw&lt;BR /&gt;Process Automation Modeller&lt;BR /&gt;Computershare&lt;BR /&gt;Europe/Bristol - UK&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jan 2020 11:29:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53844#M8459</guid>
      <dc:creator>AdamOllerenshaw</dc:creator>
      <dc:date>2020-01-17T11:29:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53845#M8460</link>
      <description>Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;can't this be related to some daylight saving time and your regional settings?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Zdeněk Kabátek&lt;BR /&gt;Head of Professional Services&lt;BR /&gt;NEOOPS&lt;BR /&gt;Europe/Prague&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jan 2020 08:45:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53845#M8460</guid>
      <dc:creator>zdenek.kabatek</dc:creator>
      <dc:date>2020-01-20T08:45:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53846#M8461</link>
      <description>The issue isn't with the JSON parser, rather it is because the results are being outputted as a datetime value. For testing purposes, I modified the JSON To Collection stage to output as text instead of date, which returns the expected GMT date. However, when that value is outputted as a DateTime, it gets converted to your local timezone. &lt;BR /&gt;&lt;BR /&gt;Since you're in the UK, your timezone follows daylight savings whereas GMT does not, that is when you're seeing the hour difference. For me personally, it's a difference of several hours since I'm on CST.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nicholas Zejdlik&lt;BR /&gt;RPA Developer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jan 2020 15:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53846#M8461</guid>
      <dc:creator>NicholasZejdlik</dc:creator>
      <dc:date>2020-01-20T15:01:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53847#M8462</link>
      <description>​Hi Nicholas &lt;BR /&gt;&lt;BR /&gt;Thanks for your reply, we deduced that it was a DST issue but were (and still are)&amp;nbsp;trying to work around it by trying to format our source data as text, which is throwing up some other issues, so your response has got us excited!&lt;BR /&gt;&lt;BR /&gt;We are pulling data back from SharePoint, but the thing is we aren't pre-defining fields so I'm wondering how you are outputting&amp;nbsp;these fields to text. Did you make amendments to the JSON to Collection code stage? I'm not very knowledgeable on code stage updates, do you have any advice/tips on how we format the output collection as text?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Adam Ollerenshaw&lt;BR /&gt;Process Automation Modeller&lt;BR /&gt;Computershare&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jan 2020 15:37:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53847#M8462</guid>
      <dc:creator>AdamOllerenshaw</dc:creator>
      <dc:date>2020-01-20T15:37:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53848#M8463</link>
      <description>Add this code to the Global Code (Initialise page -&amp;gt; double click the page information box -&amp;gt; Global Code)&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;Private Function &lt;SPAN class="token function"&gt;ConvertDateTimeToText&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;ByVal Table As DataTable&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; As DataTable
	Dim Result As New &lt;SPAN class="token class-name"&gt;DataTable&lt;/SPAN&gt;
	For Each Column As DataColumn In Table&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns
		If Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;DataType &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetType&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;DateTime&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; Then
			Result&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetType&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;String&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
		Else
			Result&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;DataType&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
		End If
	Next

	For Each Row As DataRow In Table&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Rows
		Dim NewRow As DataRow &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Result&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;NewRow&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
		For Each Column As DataColumn In Table&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Columns
			If Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;DataType &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetType&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;DataTable&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; Then
				&lt;SPAN class="token function"&gt;NewRow&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ConvertDateTimeToText&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Row&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
			Else
				&lt;SPAN class="token function"&gt;NewRow&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Row&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;Column&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ColumnName&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
			End If
		Next
		Result&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;Rows&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;NewRow&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;
	Next
	Return Result
End Function​&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;Then modify the JSON To Collection stage with the following:&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;result &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ConvertDateTimeToText&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ConvertToDataTable&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;json&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;​&lt;/PRE&gt;
&lt;BR /&gt;All of the fields returned in the JSON conversion will be changed from DateTime to Text, which will keep Blue Prism from trying to automatically convert the DateTime. The ConvertDateTimeToText() function is recursive, so it will work with nested JSON as well.&lt;BR /&gt;&lt;BR /&gt;On a trivial side note, I realized Blue Prism isn't trying to convert the DateTimes to local time, rather it is trying to convert from local time to UTC, which is why you ended up -1 hour instead of +1 hour. There may be a better way to handle this particular issue on version 6, but I am constrained to version 5 currently and this is the best solution I've found so far.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nicholas Zejdlik&lt;BR /&gt;RPA Developer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jan 2020 18:39:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53848#M8463</guid>
      <dc:creator>NicholasZejdlik</dc:creator>
      <dc:date>2020-01-20T18:39:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53849#M8464</link>
      <description>​thanks Nicholas for all your help&amp;nbsp;i'll try this&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Adam Ollerenshaw&lt;BR /&gt;Process Automation Modeller&lt;BR /&gt;Bristol/United Kingdom&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jan 2020 08:37:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53849#M8464</guid>
      <dc:creator>AdamOllerenshaw</dc:creator>
      <dc:date>2020-01-21T08:37:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53850#M8465</link>
      <description>Hi Nicholas,&lt;BR /&gt;I have been having the same issue in that Date, Time, DateTime all come out as DateTime which causes issues with the validation of data.&lt;BR /&gt;I attempted to use the code you supplied however after copying the code into the Global Code and modifying the stage i get an error of:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;Internal : Could not execute code stage because exception thrown by code stage: Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;I am very unfamiliar with code stages so unsure what the cause/solution would be - are you able to help?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;James Gregory&lt;BR /&gt;RPA Developer&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Jul 2021 08:29:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53850#M8465</guid>
      <dc:creator>jgregor4</dc:creator>
      <dc:date>2021-07-19T08:29:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53851#M8466</link>
      <description>JSON does not know anything about dates. What .NET does is a non-standard hack/extension. The problem with &lt;A href="http://net-informations.com/jq/iq/jdate.htm" target="_blank" rel="noopener"&gt;dates in JSON&lt;/A&gt; and really JavaScript in general – is that there's no equivalent literal representation for dates. In JavaScript following Date constructor straight away converts the milliseconds since 1970 to Date as follows:&lt;BR /&gt;&lt;BR /&gt;var jsonDate = new Date(1297246301973);&lt;BR /&gt;&lt;BR /&gt;Then let's convert it to js format:&lt;BR /&gt;&lt;BR /&gt;var date = new Date(parseInt(jsonDate.substr(6)));&lt;BR /&gt;&lt;BR /&gt;The substr() function takes out the /Date( part, and the parseInt() function gets the integer and ignores the )/ at the end. The resulting number is passed into the Date constructor .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;foster carly&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Aug 2021 05:48:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53851#M8466</guid>
      <dc:creator>fostercarly</dc:creator>
      <dc:date>2021-08-02T05:48:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53852#M8467</link>
      <description>&lt;SPAN&gt;The issue isn't with the JSON parser,&lt;BR /&gt;&lt;BR /&gt;rather it is because the results are being outputted as a datetime value.&lt;BR /&gt;&lt;BR /&gt;For testing purposes,&lt;BR /&gt;&lt;BR /&gt;I modified the JSON To Collection stage to output as text instead of date,&lt;BR /&gt;&lt;BR /&gt;which returns the expected GMT date.&lt;BR /&gt;&lt;BR /&gt;However, when that value is outputted as a DateTime,&lt;BR /&gt;&lt;BR /&gt;it gets converted to your local timezone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you're in the UK, your timezone follows daylight savings whereas GMT does not,&lt;BR /&gt;&lt;BR /&gt;that is when you're seeing the hour difference.&lt;BR /&gt;&lt;BR /&gt;For me personally, it's a difference of several hours since I'm on CST.&lt;BR /&gt;&lt;/SPAN&gt;------------------------------&lt;BR /&gt;&lt;A href="https://thehellerapproach.com/" target="_blank" rel="noopener"&gt;&lt;SPAN data-sheets-value="{&amp;quot;1&amp;quot;:2,&amp;quot;2&amp;quot;:&amp;quot;The Heller Approach&amp;quot;}" data-sheets-userformat="{&amp;quot;2&amp;quot;:1,&amp;quot;3&amp;quot;:{&amp;quot;1&amp;quot;:0,&amp;quot;3&amp;quot;:1}}"&gt;The Heller Approach&lt;/SPAN&gt;&lt;/A&gt;&lt;BR /&gt;------------------------------</description>
      <pubDate>Mon, 02 Aug 2021 19:56:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53852#M8467</guid>
      <dc:creator>NathanAlex</dc:creator>
      <dc:date>2021-08-02T19:56:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53853#M8468</link>
      <description>Usually you just need to apply .ToLocalTime() before returning datetime to Blueprism objects from code stage to avoid this mess. This small change in global code of json VBO should do the trick. Make sure it doesn't break other processes, maybe make a copy of that VBO.&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;    Private Function DeserialiseGeneric(ByVal o As Object, ByVal populate As Boolean) As Object
        Dim a As JArray = TryCast(o, JArray)
        If a IsNot Nothing Then
            Return DeserialiseArray(a, populate)
        End If

        Dim jo As JObject = TryCast(o, JObject)
        If jo IsNot Nothing Then
            Return DeserialiseObject(jo, populate)
        End If

        Dim jv As JValue = TryCast(o, JValue)
        If jv IsNot Nothing Then
			If GetTypeOf(jv.Value) = GetTypeOf(datetime) Then
				Return jv.Value.ToLocalTime()
			Else
				Return jv.Value
			End if
        End If

        Return JSON.Null
    End Function​&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Andrey Kudinov&lt;BR /&gt;Project Manager&lt;BR /&gt;MobileTelesystems PJSC&lt;BR /&gt;Europe/Moscow&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Aug 2021 14:19:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53853#M8468</guid>
      <dc:creator>AndreyKudinov</dc:creator>
      <dc:date>2021-08-04T14:19:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53854#M8469</link>
      <description />
      <pubDate>Fri, 14 Jan 2022 17:48:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53854#M8469</guid>
      <dc:creator>BhawanaDaultani</dc:creator>
      <dc:date>2022-01-14T17:48:00Z</dc:date>
    </item>
    <item>
      <title>RE: JSON to Collection Weid Dates Issue</title>
      <link>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53855#M8470</link>
      <description>The JSON specification does not specify a format for exchanging dates which is why there are so many different ways to do it. JSON does not know anything about dates. What .NET does is a non-standard hack/extension. The problem with &lt;A href="http://net-informations.com/jq/iq/jdate.htm" target="_blank" rel="noopener"&gt;JSON date&lt;/A&gt; and really JavaScript in general – is that there's no equivalent literal representation for dates. In JavaScript following Date constructor straight away converts the milliseconds since 1970 to Date as follows:&lt;BR /&gt;&lt;BR /&gt;var jsonDate = new Date(1297246301973);&lt;BR /&gt;&lt;BR /&gt;Then let's convert it to js format:&lt;BR /&gt;&lt;BR /&gt;var date = new Date(parseInt(jsonDate.substr(6)));&lt;BR /&gt;&lt;BR /&gt;The substr() function takes out the /Date( part, and the parseInt() function gets the integer and ignores the )/ at the end. The resulting number is passed into the Date constructor .&lt;BR /&gt;&lt;BR /&gt;For ISO-8601 formatted JSON dates, just pass the string into the Date constructor:&lt;BR /&gt;&lt;BR /&gt;var date = new Date(jsonDate);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;warren felsh&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 16 May 2022 07:22:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/JSON-to-Collection-Weid-Dates-Issue/m-p/53855#M8470</guid>
      <dc:creator>warrenfelsh</dc:creator>
      <dc:date>2022-05-16T07:22:00Z</dc:date>
    </item>
  </channel>
</rss>

