I'm trying to call a Webservice with a DateTime format like this :
x is the millisecond value since 1970.
How can I generate a DateTime in this format?
Here is what i've done :
dateValidation_long = dateValidation_string.getTime(); String a = '\\/Date('; String b = ')\\/'; modifierEntiteDeFacturation3C_request.dateValidation = a + dateValidation_long + b;
Here is the result in my console :
Then, i'm trying to JSON.serialize this date, to send it via a Webservice, and this is the result :
The webservice response is not OK because the format is different as expected :
DateTime content '\/Date(1505904139000)\/' does not start with '\/Date(' and end with ')\/' as required for JSON.