question

Upvotes
Accepted
322 5 12 16

How to convert Datastream datetime ?

I’m receiving date/timestamps in the format of "\/Date(1415750400000+0000)\/" in the response. Can you please explain how I can convert this to a regular date/time format?

datastream-apidsws-apidate
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
1.1k 3 3 3

@LarryT

In this date format \/Date(XXXXXX+XXXX)\/ we have two parts:

  1. “XXXXXX” part is the number of milliseconds since 1 January 1970
  2. “+XXXX” part indicates the time zone, so when you see “+0000”, it means the server time zone is UTC.

We use the default Microsoft .NET JSON serialization engine which emits JSON date as the number of milliseconds elapsed since 01-01-1970 UTC.

A relevant documentation on this can be found from the MSDN site here under section “DateTime Wire Format”.

You can also use XML transport if the JSON format is inconvenient for you. REST/XML returns dates in the format of “CCYY-MM-DDT00:00:00” – e.g. 2016-11-21T00:00:00.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you, that is helpful

Click below to post an Idea Post Idea