简体   繁体   中英

toLocaleString() format changed in Chrome

new Date().toLocaleString() in Chrome now returns: 3/13/2013 9:25:28 AM

It used to return: Tue Oct 30 2012 23:59:59 GMT-0500 (Central Daylight Time)

Why/when did it change? Thank you.

The string depends on locale, have you recenlty upgraded your browser? That could be why.

Check the (window.)navigator language parameters in debug, for example navigator.language to determine if the language of your browser has changed from what you expect it to be.

You might want to pick out parts of the Date object and construct your own string (preferably after some standard) to aviod this kind of event for users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM