# iso-date

> Get a ISO date string, i.e. 'YYYY-MM-DD', from a Date

Latest version **1.0.0** (published 2015-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install iso-date
pnpm add iso-date
yarn add iso-date
bun add iso-date
```

## 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.0.0 |
| Published | 2015-10-05 |
| First published | 2015-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Joakim Carlstein |
| Maintainers | joakimbeng |
| Keywords | date, dateformat, format, string, iso, iso date |

## Links

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

## Dependencies (1)

- [is-date-object](https://npm.io/package/is-date-object.md) ^1.0.1

## 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.0.0 (latest) — 2015-10-05

## README

# iso-date

[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![js-xo-style][codestyle-image]][codestyle-url]

> Get a ISO date string, i.e. 'YYYY-MM-DD', from a Date

## Installation

Install `iso-date` using [npm](https://www.npmjs.com/):

```bash
npm install --save iso-date
```

## Usage

### Module usage

```javascript
var isoDate = require('iso-date');

isoDate('2011-11-11 11:11:11');
// "2011-11-11"
isoDate(1444047247887);
// "2015-10-05"
isoDate();
// todays date, e.g: "2015-10-05"
isoDate(new Date());
// todays date, e.g: "2015-10-05"
```

## API

### `isoDate(date)`

| Name | Type | Description |
|------|------|-------------|
| date | `String|Number|Date|undefined` | The date to get an ISO date from |

Returns: `String`, a date string on the format "YYYY-MM-DD".

## License

MIT © Joakim Carlstein

[npm-url]: https://npmjs.org/package/iso-date
[npm-image]: https://badge.fury.io/js/iso-date.svg
[travis-url]: https://travis-ci.org/joakimbeng/iso-date
[travis-image]: https://travis-ci.org/joakimbeng/iso-date.svg?branch=master
[codestyle-url]: https://github.com/sindresorhus/xo
[codestyle-image]: https://img.shields.io/badge/code%20style-xo-brightgreen.svg?style=flat

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