format-moment-test

1.0.1 • Public • Published

winxp_df

Introduction

  • 获取时间,转化时间格式,将时间格式化成自己需要的样式:
  1. 2017年01月11日
  2. 2017年01月11日 18:11:20
  3. 2017-01-11 18:11:20
  4. 2017/01/11 18:11:20
  5. ...

Install

  • npm install format-moment
  • bower install format-moment

Usage

const formatMoment = require('format-moment');

console.log(formatMoment.getTime('xxxx-xx-xx xx:xx:xx'));

console.log(formatMoment.formatTime({
    date: new Date('2018-02-03 10:05:05'),
    format: 'xxxx年xx月xx日 xx:xx:xx'
}));

Api


getTime 获取当前的时间  

formatTime 过滤时间格式

Readme

Keywords

Package Sidebar

Install

npm i format-moment-test

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

5.93 kB

Total Files

5

Last publish

Collaborators

  • castshark