@licq/date
Version:
封装一些日期的操作方法
41 lines (28 loc) • 893 B
Markdown
封装一些日期的操作方法
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
[]: http://img.shields.io/npm/v/@licq/date.svg?style=flat-square
[]: http://npmjs.org/package/@licq/date
[]: https://img.shields.io/npm/dm/@licq/date.svg?style=flat-square
[]: https://npmjs.org/package/@licq/date
```js
npm i --save-dev @licq/date
```
格式化日期
**Returns**: String
**Since**: v1.0.0
| Param | Type | Description |
| --- | --- | --- |
| format | <code>String</code> | 格式 default: 'yyyy-MM-dd hh:mm:ss' |
| date | <code>Date</code> | 日期 default: new Date() |
**Example**
```js
const date = require('@licq/date')
const res = date.formatTime()
//==> eg: 2022-01-09 17:58:02
const res = date.formatTime('yyyy-MM-dd')
//==> eg: 2022-01-09
```