@darkwolf/timestamp

1.1.6 • Public • Published

Timestamp

Install

npm i --save @darkwolf/timestamp

Usage

// ECMAScript
import Timestamp from '@darkwolf/timestamp'
// CommonJS
const Timestamp = require('@darkwolf/timestamp')

const now = new Timestamp()

`${new Timestamp('1970-01-01T00:00:00Z')}` // => '1970-01-01T00:00:00.000000000Z'
`${new Timestamp('2038-01-19T03:14:07Z')}` // => '2038-01-19T03:14:07.000000000Z'
`${new Timestamp('1900-12-31T23:59:59.999999999Z')}` // => '1900-12-31T23:59:59.999999999Z'
`${new Timestamp('2021-07-13T23:59:59.999999999Z')}` // => '2021-07-13T23:59:59.999999999Z'
`${Timestamp.from({
  year: 2021,
  month: 7,
  day: 13,
  hour: 23,
  minute: 59,
  second: 59,
  millisecond: 999,
  microsecond: 999,
  nanosecond: 999
})}` // => '2021-07-13T23:59:59.999999999Z'

API Documentation

Contact Me

GitHub: @PavelWolfDark

Telegram: @PavelWolfDark

Email: PavelWolfDark@gmail.com

Package Sidebar

Install

npm i @darkwolf/timestamp

Weekly Downloads

2

Version

1.1.6

License

MIT

Unpacked Size

107 kB

Total Files

6

Last publish

Collaborators

  • pavelwolfdark