使用方法
-
npm install czz-format-date --save
-
import {formatDateTime} from 'czz-format-date'
-
或
-
const formatDateTime = require('../../utils/util')
-
formatDateTime.formatDate(date, fmt)
- 根据时间戳 得到格式化之后的日期
- //date时间戳, fmt 需要的日期格式 eg: 'yyyy-MM-dd hh:mm:ss' , 'YYYY年MM月DD HH:mm:SS'
-
formatDateTime.timeFormatDate(date, fmt)
- 根据传入的时间戳,距离未来一个时间戳的格式化时间
- //date时间戳, fmt 需要的日期格式 eg: 'yyyy-MM-dd hh:mm:ss' , 'YYYY年MM月DD HH:mm:SS'