当我阅读Mozilla Developer Network上有关JavaScript中
Date
对象的参考资料时,我看到了这个注释:
为什么?You shouldn't use this method in contexts where you rely on a particular format or locale.
"Last visit: " + someDate.toLocaleDateString(); // Good example "Last visit was at " + someDate.toLocaleDateString(); // Bad example