Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-2
rated 0 times [  1] [ 3]  / answers: 1 / hits: 15347  / 13 Years ago, sun, september 4, 2011, 12:00:00

I use the 3 browsers to output this result.



Chrome:



new Date().toLocaleString()
> Sun Sep 04 2011 21:40:04 GMT+0800 (HKT)


Safari:



new Date().toLocaleString()
> 2011年9月4日 下午09时54分51秒格林尼治标准时间+0800


FF:



new Date().toLocaleString()
> Sun Sep 4 21:46:03 2011


why not the same output result? timezoom?


More From » date

 Answers
56

It depends on the configuration of the computer, the user's preferred date format, obviously the user's locale, and how the browser determines this.



You should really prefer using a proper date library such as datejs for formatting.



See their Date.toString() and format specifiers.


[#90274] Friday, September 2, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kamronr

Total Points: 749
Total Questions: 110
Total Answers: 122

Location: Dominica
Member since Sat, Nov 5, 2022
2 Years ago
kamronr questions
Mon, Dec 21, 20, 00:00, 3 Years ago
Fri, Oct 16, 20, 00:00, 4 Years ago
Sat, Oct 3, 20, 00:00, 4 Years ago
Sun, Jul 28, 19, 00:00, 5 Years ago
;