# @joefallon/mysql-date

> An easy to use utility for converting to and from MySQL formatted date-time strings.

Latest version **0.1.2** (published 2018-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @joefallon/mysql-date
pnpm add @joefallon/mysql-date
yarn add @joefallon/mysql-date
bun add @joefallon/mysql-date
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-06-21 |
| First published | 2017-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joe Fallon |
| Maintainers | joefallon |

## Links

- npm: https://www.npmjs.com/package/@joefallon/mysql-date
- Repository: https://github.com/joefallon/mysql-date.js
- Homepage: https://github.com/joefallon/mysql-date.js#readme
- Issues: https://github.com/joefallon/mysql-date.js/issues
- npm.io page: https://npm.io/package/@joefallon/mysql-date

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.9.2
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.2.4

## Recent versions

- 0.1.2 (latest) — 2018-06-21
- 0.1.1 — 2018-03-08
- 0.1.0 — 2017-12-28

## README

# mysql-date.js

An easy to use utility for converting to and from MySQL formatted date-time strings and JS Date objects.
It is written in [TypeScript](https://www.typescriptlang.org/).

By [Joe Fallon](http://blog.joefallon.net)

http-statuses has the following features:

*   Full suite of unit tests
*   Can be fully understood in just a few moments
*   Written in TypeScript

## Installation

The easiest way to install mysql-date is with npm. 

```
npm install @joefallon/mysql-date --save
```

## Usage

```typescript
import MySqlDate from 'mysql-date';

MySqlDate.toJsDate('2012-12-12 12:12:12'); //--> '2012-12-12T20:12:12.000Z'

const jsDate = new Date(2012, 12 - 1, 12, 12, 12, 12);
const mysql  = MySqlDate.toMySqlDate(jsDate); //--> '2012-12-12 12:12:12'

MySqlDate.nowMySqlDate(); //--> 2017-12-21 15:30:33
```

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