# 3h-time

> A time formatter.

Latest version **1.2.1** (published 2018-08-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install 3h-time
pnpm add 3h-time
yarn add 3h-time
bun add 3h-time
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-08-01 |
| First published | 2018-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 3h |
| Maintainers | 3h |
| Keywords | time, date, format, formatter, fmt, 3h |

## Links

- npm: https://www.npmjs.com/package/3h-time
- Repository: https://github.com/huang2002/3h-time
- Homepage: https://github.com/huang2002/3h-time#readme
- Issues: https://github.com/huang2002/3h-time/issues
- npm.io page: https://npm.io/package/3h-time

## 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.1 (latest) — 2018-08-01
- 1.2.0 — 2018-08-01
- 1.1.1 — 2018-07-21
- 1.1.0 — 2018-07-21
- 1.0.1 — 2018-07-14
- 1.0.0 — 2018-07-10
- 0.1.5 — 2018-06-23
- 0.1.4 — 2018-06-23
- 0.1.3 — 2018-06-17
- 0.1.2 — 2018-06-17
- 0.1.1 — 2018-06-16
- 0.1.0 — 2018-06-15

## README

# 3h-time

A time formatter.

# Install

```
npm i 3h-time
```

# APIs

## Time.format(date: Date, format: string): string

Format the given date.

## Time.get(format: string):string

Equal to `Time.format(new Date(), format)`.

## Time.replacers: { [id: string]: (date: Date) => string; }

A replacer map.

# Replace map

- `YYYY` - Full year.
- `YY` - Short year.
- `MMMM` - Full month name.
- `MMM` - Short month name.
- `MM` - Month number with leading zero.
- `M` - Month number without leading zero.
- `DD` - Date number with leading zero.
- `D` - Date number without leading zero.
- `dd` - Date number with st/nd/rd/th and leading zero.
- `d` - Date number with st/nd/rd/th but without leading zero.
- `HH` - Hour(0-23) with leading zero.
- `H` - Hour(0-23) without leading zero.
- `hh` - Hour(0-11) with leading zero.
- `h` - Hour(0-11) without leading zero.
- `mm` - Minutes with leading zero.
- `m` - Minutes without leading zero.
- `SS` - Seconds with leading zero.
- `S` - Seconds without leading zero.
- `sss` - Full milliseconds with leading zero.
- `ss` - Shorter milliseconds.
- `s` - Shortest milliseconds.
- `WW` - Full day name.
- `W` - Short day name.
- `ww` - Full day number.
- `w` - Short day number.
- `A` - AM/PM.
- `a` - am/pm.

# Changelog

See [CHANGELOG.md](Changelog.md).

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