PDA

View Full Version : Get Date Object



nityajs
6 Jan 2010, 7:29 AM
Hi,


I want to get date object of format m/d/Y. I used the below which did not return the object in required format.


Date.parseDate('01/06/2010', "m/d/Y");

Tha above code returned date in like Wed 6 Jan 08:59:34 EST... which is the format I am not expect. I expect date in format of 01/06/2010 when I pass string.

Please help me with any idea of how to achieve this.

CrazyEnigma
6 Jan 2010, 10:37 AM
That's parsing not formatting.


var myDate = new Date();
myDate.format("m/d/Y");