datetime-befornow
v1.0.4
Published
datetime befornow
Downloads
14
Readme
使用流程
包的安装
npm install datetime-befornow
包的使用
首先在项目中引入所用模块
import date(自己定义的) from 'datetime-befornow/index.js'(或者const date(自己定义的)=require('datetime-befornow'))
使用示例
1.格式化(默认年限/5) let befornow=date.beforNow('2018-10-10 12:01:10') 2.格式化(指定年限/1) let befornow=date.beforNow('2018-10-10 12:01:10',1)
console.log(befornow)
成功返回的值
刚刚/多少秒前/多少分钟前/多少小时前/多少天前/多少月前/多少年前