# node.date-time

> date-time formatter for javascript

Latest version **1.2.2** (published 2017-03-13) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install node.date-time
pnpm add node.date-time
yarn add node.date-time
bun add node.date-time
```

## 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 | 1.2.2 |
| Published | 2017-03-13 |
| First published | 2016-05-18 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yeliex |
| Maintainers | yeliex |
| Keywords | date, time |

## Links

- npm: https://www.npmjs.com/package/node.date-time
- Repository: https://github.com/yeliex/node.date-time
- Homepage: https://github.com/yeliex/node.date-time#readme
- Issues: https://github.com/yeliex/node.date-time/issues
- npm.io page: https://npm.io/package/node.date-time

## Dependencies (1)

- [left-pad](https://npm.io/package/left-pad.md) ^1.1.0

## 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

- 1.2.2 (latest) — 2017-03-13
- 1.2.1 — 2017-03-13
- 1.1.1 — 2016-06-30
- 1.1.0 — 2016-06-29
- 1.0.3 — 2016-05-31
- 1.0.2 — 2016-05-19
- 1.0.1 — 2016-05-18
- 1.0.0 — 2016-05-18

## README

# node.date-time

[![npm](https://img.shields.io/npm/v/node.date-time.svg?style=flat-square)](https://www.npmjs.com/package/node.date-time)

date-time formatter for javascript

## Installation
```
$ npm install node.date-time
```

## Use with CMD
```js
const format = require("node.date-time");
console.log(new Date().format("Y-M-d")); // 2016-5-18
console.log(format("y-M-d H:m:s")); // 16-5-18 15:45:8
```

## Use with html
```js
<script src="./node_modules/node.date-time/index.js"></script>
<script>
console.log(format("Y-MM-dd HH:mm:SS", new Date())); // 2016-05-03 01:01:01
console.log(format("Y-MM-dd HH:mm:SS", "2016-5-5 1:1:1"); // 2016-05-03 01:01:01
console.log(format("Y-MM-dd HH:mm:SS ms", "20160505010101"); // 2016-05-03 01:01:01 000
</script>
```

## Api
- Date.format(format,utc)
  - format: String, "Y-MM-dd HH:mm:SS",
  - utc: Boolean, isUTC
    - default: false
- formatter(format,date,utc)

## Format

- `yyyy`,`Y`
    - A full numeric representation of a year
    - eg: 2016,1998
- `yy`,`y`
    - A two digit representation of a year
    - 16,98
- `MM`
    - A two digit representation of a month
    - 01-12
- `M`
    - A month
    - 1-12
- `dd`
    - A two digit representation of a date
    - 01-31
- `d`
    - A date
    - 1-31
- `D`
    - A day in a week
    - 0-6
- `HH`,`hh`
    - A two digit representation of a hout
    - 00-23
- `H`,`h`
    - An hour
    - 0-23
- `mm`
    - A two digit representation of a minute
    - 00-59
- `m`
    - A minute
    - 0-59
- `SS`
    - A two digit representation of a second
    - 00-59
- `S`
    - A second
    - 0-59
- `ms`
    - A microsecond
    - 000-999

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