Date formatting when using JavaScript Remoting in visualforce

Visualforce remoting is a method to invoke apex code through the javascript of the visualforce page.

One scenario where time is returned in the micro seconds format & needs to be converted in to the proper datetime. To do this I have just framed javascript method which will convert this number in to salesforce datetime format "MM/DD/YYYY HH:MM AM/PM"

ex. CreatedDate : 1482238284000

O/p : 12/20/2016 6:21 PM

Comments