MomentJS - Using Locale using Node.js


Advertisements

If you happen to use Node.js , you will have the locale files already in moment when you do npm install moment.

Example

Using

Observe the following example that is executed at Node.js end −

Example

"use strict";
var moment = require('moment');
moment.locale('fr');
var k = moment().fromNow();
console.log(k);

Output

Using Locale
momentjs_internationalization.htm
Advertisements