Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • It should work; can you provide an example of where it doesn't work, also how are you using moment (did you install it via npm, etc)? Commented May 11, 2017 at 14:16
  • 4
    With recent moments (I tested in 2.18.1) use this: moment.locale("de"); var m = moment().format("LLL") Commented Jul 21, 2017 at 8:34
  • 1
    apadana is right: you set locale with moment.locale('de'), and you create a new object representing the date of now by moment() (note the parenthesis) and then format('LLL') it. The parenthesis is important. Tested in 2.20. Also, remember to use moment-with-locale.js and if necessary, change the name to be moment.js. Django just refuse to load moment-with-locale.js in my case. Commented Dec 21, 2017 at 10:45
  • 1
    if this one is not working, try this one : moment().locale('de').format('LLL'); Commented Feb 1, 2018 at 3:06
  • This one is coorect, just don't forget to import te locale you want to use (cfr. Agu Dondo's answer). Commented Jul 22, 2019 at 10:05