jquery - What culture does the javascript Date object use? -


the language of os (windows) in danish, , language of browsers.

when trying parse date in danish format (dd-mm-yyyy) this:

var x = "18-08-1989" var date = new date(x); 

i wrong date javascript (i want 18'th of august 1989). when transform string english, , parse it, returns correct date.

does format of date string have be: yyyy-mm-dd when using js date object??

in basic use without specifying locale, formatted string in default locale , default options returned.

var date = new date(date.utc(2012, 11, 12, 3, 0, 0));  // tolocalestring without arguments depends on implementation, // default locale, , default time zone date.tolocalestring(); // "12/11/2012, 7:00:00 pm" if run in en-us locale time zone america/los_angeles 

using locales

var date = new date(date.utc(2012, 11, 20, 3, 0, 0));  // formats below assume local time zone of locale; // america/los_angeles  // english uses month-day-year order alert(date.tolocalestring("en-us")); // "12/19/2012, 7:00:00 pm"  // british english uses day-month-year order alert(date.tolocalestring("en-gb")); // "20/12/2012 03:00:00"  // korean uses year-month-day order alert(date.tolocalestring("ko-kr")); // "2012. 12. 20. 오후 12:00:00" 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -