- MomentJS 教程
- MomentJS - 主页
- MomentJS - 概述
- MomentJS - 环境设置
- MomentJS - 简介
- MomentJS - 解析日期和时间
- MomentJS - 日期验证
- MomentJS - 获取器/设置器
- 操作日期和时间
- 格式化日期和时间
- MomentJS - 日期查询
- MomentJS - 国际化
- MomentJS - 自定义
- MomentJS - Duration
- MomentJS - 实用程序
- MomentJS - 插件
- MomentJS - 示例
- MomentJS 有用资源
- MomentJS - 快速指南
- MomentJS - 有用资源
- MomentJS - 讨论
MomentJS - 使用 Node.js 使用区域设置
如果您碰巧使用 Node.js,在执行 npm install moment 时它将在 moment 中已具有区域设置文件。
示例
观察在 Node.js 末尾执行的以下示例 -
示例
"use strict";
var moment = require('moment');
moment.locale('fr');
var k = moment().fromNow();
console.log(k);
输出
momentjs_internationalization.htm
广告