Playing with Dates in Dojo

To convert a ISOString into a Date object, use dojo.date.stamp.fromISOString. For example:

var dateObj = dojo.date.stamp.fromISOString("2011-04-26T19:30:40+0000"))

To convert a Date object into a localized date format which you would like, 3 parameters I regularly tend to use are “selector” and “formatLength” and “datePattern”:

dojo.date.locale.format( dateObj, {selector:'date', formatLength:'full'} )
//returns  "Tuesday, April 26, 2011"

You can also specify different datePatterns like datePattern: “yyyyMMdd”, etc. More details here.

A useful link for confirming to regular cultural conventions here.