var d = new Date();
document.write(d);
What will it print. It normally prints time of local machine. Will it print time in French language if machine’s language is French?
Or is JavaScript outputs just in English?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The contents of all
Date.prototype.to*Stringmethods are implementation-dependant (a la the standard in section 15.9). They are however based on an ISO representation which is in English. So basically, the default is always English. When it comes toDate.prototype.toLocale*Stringmethods the standards say the string should be one thatHowever there are still some implementation differences:
In FF 4:
Date.prototype.toLocaleString()uses the OS settings.Date.prototype.toString()is always in [American] English.While in Chrome 14:
Both are always English. This has already been noticed.
Test for yourselves: http://jsfiddle.net/USJeE/