Lodash教程

Lodash date

Lodash 提供了一个 now 函数来以毫秒为单位获取当前时间。

语法

_.now()
获取自 Unix 纪元(1970 年 1 月 1 日 00:00:00 UTC)以来经过的毫秒数时间戳。

输出

(number)-返回时间戳。

示例

var _ = require('lodash');
var result = _.now();
console.log(result);
将上述程序保存在 tester.js 中。运行以下命令来执行这个程序。

命令

\>node tester.js

输出

1601614929848
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4