user123_456
user123_456

Reputation: 5795

How to return local date in another language?

How can I return local date string in some other language and not in english?

I am using this:

new Date().toLocaleDateString()

Upvotes: 0

Views: 260

Answers (1)

raina77ow
raina77ow

Reputation: 106365

You cannot change locale in JS. I'd suggest using MomentJS library for processing dates. With it your request can be solved as easily as...

var localLang = moment();
localLang.lang('fr');     // set this instance to use French
localLang.format('LLLL'); // dimanche 15 juillet 2012 11:01

Upvotes: 1

Related Questions