JSON schema question

63 views
Skip to first unread message

Jared Whiklo

unread,
Sep 4, 2024, 5:27:21 PMSep 4
to ORCID API Users
Hi all,

Brand new to the ORCID API and schema, but have been playing with it a little and have a question.

I am wondering about the last-modified-date and created-date format? 

In XML it's a readable and parseable xs:dateTime object.
<history:history>
<history:creation-method>Direct</history:creation-method>
<history:submission-date>2015-03-04T17:02:25.546Z</history:submission-date>
<common:last-modified-date>2024-08-22T18:46:18.419Z</common:last-modified-date>
<history:claimed>true</history:claimed>
<history:verified-email>true</history:verified-email>
<history:verified-primary-email>true</history:verified-primary-email>
</history:history>

 In JSON it is a number.
"history": {
"creation-method": "DIRECT",
"completion-date": null,
"submission-date": {
"value": 1425488545546
},
"last-modified-date": {
"value": 1724352378419
},
"claimed": true,
"source": null,
"deactivation-date": null,
"verified-email": true,
"verified-primary-email": true
},

It is not clear to me how this number is derived from the date, I am guessing it comes from the XmlGregorianCalendar class used in the model?

So my question is how can I get the actual date from this numeric value without using Java?

cheers,
jared

Owen Stephens

unread,
Sep 5, 2024, 9:31:13 AMSep 5
to Jared Whiklo, ORCID API Users
Hi Jared,

That’s the “epoch” (time since 1st January 1970) in milliseconds. An explanation of how epoch time/dates work, and how to convert an epoch time to a date in a variety of programming languages, as well as options for pasting in an epoch time and getting a human readable date back are available at https://www.epochconverter.com/. I hope this helps

Best wishes

Owen

Jared Whiklo

unread,
Sep 5, 2024, 10:11:12 AMSep 5
to ORCID API Users
Thank you Owen,

I thought it might be a timestamp, but I was not thinking microseconds.

cheers,
jared
Reply all
Reply to author
Forward
0 new messages