I\'m trying to send a DateTime
as a parameter to a method exposed over a WCF RESTful service with JSON encoding. The request looks like this:
POST h
The correct format for posting dates to WCF service is using:
/Date(53244000000)/
where the number in brackets is the number of milliseconds since 1970 UTC Midnight.
Date dt = new Date();
long date = Date.UTC(dt.getYear(), dt.getMonth(), dt.getDay(), dt.getHours(),dt.getMinutes(), dt.getSeconds());
String senddate = "/date("+date+")/";
And then use it as below
inputparam.put("DateTime", datetime);