dojo.date.locale.parse takes a formatted string and returns a Date Javascript object.
var x = dojo.date.locale.parse('05/17/2010', {datePattern: "MM/dd/yyyy", selector: "date"});
When you speak
alert(x);
which forces x to a string using the Date.toString () method, which is browser dependent, but will give you a result like what you got. - May 17, 2010 00:00:00 GMT-0500 (Central Daylight Time)
If you want to format the date in a special way, pass the result of your analysis to dojo.date.locale.format with a specific date format:
var y = dojo.date.locale.format(x, {datePattern:"MMMM d, yyyy", selector: 'date'});
source share