Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > SpiraTeam Issues & Questi... > REST json Date property f...
SpiraTeam uses the WCF JSON serialization library from Microsoft .NET to convert dates into JSON. You can read more about this format here.
Basically, Dates in SpiraTeam are represented in JSON as "\/Date(number of ticks)\/".
The number of ticks is a positive or negative long value that indicates the number of ticks (milliseconds) that have elapsed since midnight 01 January, 1970 UTC.
Then let's convert it to js format:
var date = new Date(parseInt(jsonDate.substr(6)));
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 .
For ISO-8601 formatted JSON dates, just pass the string into the Date constructor:
var date = new Date(jsonDate);
And if you have any questions, please email or call us at +1 (202) 558-6885