# lc-time-format

> Format time to custom style

Latest version **2.0.2** (published 2020-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install lc-time-format
pnpm add lc-time-format
yarn add lc-time-format
bun add lc-time-format
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2020-08-16 |
| First published | 2016-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | JamesYin |
| Maintainers | elantion |
| Keywords | time, format |

## Links

- npm: https://www.npmjs.com/package/lc-time-format
- Repository: https://github.com/lazycoffee/lc-time-format
- Homepage: https://github.com/lazycoffee/lc-time-format#readme
- Issues: https://github.com/lazycoffee/lc-time-format/issues
- npm.io page: https://npm.io/package/lc-time-format

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2020-08-16
- 2.0.1 — 2020-08-16
- 2.0.0 — 2020-08-16
- 1.0.8 — 2019-11-19
- 1.0.7 — 2019-11-19
- 1.0.6 — 2018-02-28
- 1.0.5 — 2017-11-29
- 1.0.4 — 2017-11-07
- 1.0.3 — 2017-06-05
- 1.0.2 — 2017-06-05
- 1.0.1 — 2016-11-10
- 1.0.0 — 2016-11-10

## README

# lc-time-format

Transfer date to custom formate.

## usage

Pass a Date instance or a stander date string, and a formatter string,<br />
return a formatted time string.

```javascript
import timeFormat from 'lc-time-format';
const formattedStr = timeFormat(
    new Date('2016', '8', '8', '5', '8', '7'),
    'YMD-HNS'
);
// or apply a date string
const formattedStr = timeFormat('Sep 08 2016 05:08:07 +8', 'YMD-HNS');
// 20160908-050807
```

```text

Y -> 2016
y -> 16

M -> 09
m -> 9

D -> 08
d -> 8

H -> 05
h -> 5

N -> 08
n -> 8

S -> 07
s -> 7
```

## License

MIT

---
_Source: https://npm.io/package/lc-time-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
