# dateformats

> Converts between datetime formats from DotNet, moment.js, jQueryUI datepicker, timepicker.

Latest version **1.0.2** (published 2016-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install dateformats
pnpm add dateformats
yarn add dateformats
bun add dateformats
```

## 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.2 |
| Published | 2016-11-17 |
| First published | 2016-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lu Chao |
| Maintainers | deerchao |
| Keywords | date, time, format |

## Links

- npm: https://www.npmjs.com/package/dateformats
- npm.io page: https://npm.io/package/dateformats

## 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.2 (latest) — 2016-11-17
- 1.0.1 — 2016-11-17
- 1.0.0 — 2016-11-16

## README

# dateformats
This library allows you to easily convert date time formats between .Net, moment.js, jQueryUI datepicker, Timepicker.

## Usage

	// Convert from DotNet to Timepicker ("at HH:mm:ss.fff" => "'at 'HH:mm:ss.l")
	dateFormat.convert('at HH:mm:ss.fff', dateFormat.dotNet, dateFormat.timepicker)

Here are all the formats:

- `dotNet` [DateTime(.net class)](https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx)
- `momentJs` [moment.js](http://momentjs.com/docs/#/displaying/format/)
- `datepicker` [jQueryUI datepicker](http://api.jqueryui.com/datepicker/#utility-formatDate)
- `timepicker` [Timepicker](http://trentrichardson.com/examples/timepicker/#tp-formatting)
- `standard` my own format

## Background

Some days ago I wrote this for my requirements and posted it on [stackoverflow](http://stackoverflow.com/questions/20101603). I was asked to put it on [github](https://github.com/deerchao/dateformats) and npm, so here it is.

It comes in C# and TypeScript/JavaScript, you can use either or both. Several syntaxes are ignored during the conversion due to lack of support in most other rules, such as week of year in moment.js, however what got left is sufficient for many scenario in my opinion. 

I also created my own *standard* rule, I mean to stick to it in my future projects and convert to *local* format only at the last minute. Just remove it if you don't like it. You can also easily create other rules too, if necessary.

It is tested more or less, though I can't say that there aren't any bugs. Use it at your own risk.

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