DateTime in REST Api

Hello,

excuse the stupid question, but how does the conversion of dates in the REST API?

The date is in Unix format time but I can not write write it correctly.

If something is not wrong

var instanceTime = (DateTime.Now - (new DateTime(1970,1,1)).TotalSecond;


(DateTime.Now - (01/01/1970)) take the number of seconds

is that correct? works with the date format UTC

Thank you

2 comments
Comment actions Permalink

Hello. Denis!

You should pass DateTime in milliseconds sice 01.01.1970.

0
Comment actions Permalink
Hi, I just tried to send "1363780800000" as a value for a datetime field and got a bad request.
0

Please sign in to leave a comment.