function GetDa开发者_JAVA百科teInLocalFormat(strDate) {
if (strDate == undefined)
return ""
var dateVal = new Date(strDate));
if (dateVal == null || isNaN(dateVal)) {
return "";
}
return dateVal.localeFormat(Sys.CultureInfo.CurrentCulture.dateTimeFormat.ShortDatePattern);
}
I'm using the above function in Javascript display the date in localized format, new Date(strDate) is not working as expected.
Any suggestions to do date globalization in Javascript?
Try the Globalize library (originating from Microsoft, it was promoted as an official jQuery plugin, and then made available as a simple Javascript library).
精彩评论