JSON and dates

I don’t know if this is off topic or not. I’m trying to use a REST api from not epicor, from Epicor.

Anyways, one of the body parameters is the due date. The one shown below translates to 10/18/17.

Is this a standard JSON thing? or is this going to be specific to the API?

image

Found my answer (I think), now I just have to learn how to go back and forth.

JSON is very tied to Javascript, and the DateTime classes are very vast. I think “seconds since epoch” (or maybe milliseconds) , is the most common “base”.

One thing to watch out for is for time zones. And the DateTime as a string is fully supported, in the form of "2015-03-25T12:00:00Z"

and

Date and time is separated with a capital T.
UTC time is defined with a capital letter Z.

If you want to modify the time relative to UTC, 
remove the Z and add +HH:MM or -HH:MM instead:
"2015-03-25T12:00:00-06:30"

Notice the timezone offset at the end. (not sure what TZ is 6-1/2 Hrs off of GMT…)

Cocos (Keeling) Islands: UTC +06:30

That’s crazy!
:wink:

I just needed the date, so I didn’t have to worry about time zones. I just googled some C# conversions to epoch and gotter figured out! I just had to know what I was trying to convert too! All good now.

No I can skip sending and email to zapier and go right from Epicor to my end point. Skipping 2 fragilities 1.email and 2. Zapier.

2 Likes