source: node_modules/postgres-date/readme.md@ 33517cc

finki-main main
Last change on this file since 33517cc was 62b2964, checked in by Klimentina Efremova <klimentina08642@…>, 2 weeks ago

Project Handcraft Marketplace

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[62b2964]1# postgres-date [![Build Status](https://travis-ci.org/bendrucker/postgres-date.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-date) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/postgres-date.svg)](https://greenkeeper.io/)
2
3> Postgres date output parser
4
5This package parses [date/time outputs](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT) from Postgres into Javascript `Date` objects. Its goal is to match Postgres behavior and preserve data accuracy.
6
7If you find a case where a valid Postgres output results in incorrect parsing (including loss of precision), please [create a pull request](https://github.com/bendrucker/postgres-date/compare) and provide a failing test.
8
9**Supported Postgres Versions:** `>= 9.6`
10
11All prior versions of Postgres are likely compatible but not officially supported.
12
13## Install
14
15```
16$ npm install --save postgres-date
17```
18
19
20## Usage
21
22```js
23var parse = require('postgres-date')
24parse('2011-01-23 22:15:51Z')
25// => 2011-01-23T22:15:51.000Z
26```
27
28## API
29
30#### `parse(isoDate)` -> `date`
31
32##### isoDate
33
34*Required*
35Type: `string`
36
37A date string from Postgres.
38
39## Releases
40
41The following semantic versioning increments will be used for changes:
42
43* **Major**: Removal of support for Node.js versions or Postgres versions (not expected)
44* **Minor**: Unused, since Postgres returns dates in standard ISO 8601 format
45* **Patch**: Any fix for parsing behavior
46
47## License
48
49MIT © [Ben Drucker](http://bendrucker.me)
Note: See TracBrowser for help on using the repository browser.