postgres-date

Postgres date column parser

MIT 12 个版本
安装
npm install postgres-date
yarn add postgres-date
pnpm add postgres-date
bun add postgres-date
README

postgres-date tests

Postgres date output parser

This package parses date/time outputs from Postgres into Javascript Date objects. Its goal is to match Postgres behavior and preserve data accuracy.

If you find a case where a valid Postgres output results in incorrect parsing (including loss of precision), please create a pull request and provide a failing test.

Supported Postgres Versions: >= 9.6

All prior versions of Postgres are likely compatible but not officially supported.

Install

npm install --save postgres-date

Usage

const parse = require('postgres-date')
parse('2011-01-23 22:15:51Z')
// => 2011-01-23T22:15:51.000Z

API

parse(isoDate) -> date

isoDate

Required
Type: string

A date string from Postgres.

Releases

The following semantic versioning increments will be used for changes:

  • Major: Removal of support for Node.js versions or Postgres versions (not expected)
  • Minor: Unused, since Postgres returns dates in standard ISO 8601 format
  • Patch: Any fix for parsing behavior

License

MIT © Ben Drucker

版本列表
2.1.0 2021-12-08
2.0.1 2021-03-09
2.0.0 2020-10-29
1.0.7 2020-08-28
1.0.6 2020-08-05
1.0.5 2020-04-13
1.0.4 2019-04-03
1.0.3 2016-07-06
1.0.2 2016-05-19
1.0.1 2015-12-31
1.0.0 2015-06-13
0.0.0 2015-06-13