We have a Java new Date(); which returns the date as below:
Mon Feb 19 19:51:21 IST 2018
And the javascript Date() function returns the date in a format like below:
Mon Feb 19 2018 20:31:37 GMT+0530 (India Standard Time)
I have a rest webservice which accepts the date in exact format as that of Java's date (Mon Feb 19 19:51:21 IST 2018).
In an ajax request, I am passing an xml content which has a date tag along with other xml tags like id and author. Example below. If I send an xml like below, the date field gets ignored as the Date format expected in the rest webservice is different than the one below.
<message>
<autor>User2</autor>
<date>Mon Feb 19 2018 20:02:03 GMT+0530 (India Standard Time)</date>
<id>1</id>
<message>Message2</message>
</message>