1.1.0 • Published 5 years ago

shitty-date v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

Locale dates

const DATE = require(`shitty-date`)

//Initialize new date (now) with specified locale
const date = DATE('America/Toronto')

//Get datetime
let locale = date.get()

//Get datetime with another specified locale
let utc = date.get('UTC')

Initialize with specified timestamp

const timestamp = 1588551082176
const date = DATE('Europe/Lisbon', timestamp)

Options

  • timezone : Timezone string
  • timestamp : Initialization time (Defaut is now)

Adjusting the time parameters

const date = DATE('Asia/Hong_Kong')
date.set({ h:10, m:20 })

Options

  • yy : Year
  • mm : Month
  • dd : Day
  • h : Hours
  • m : Minutes
  • s : Seconds
  • ms : Milliseconds

Recall time with locale overrides

const date = DATE('Europe/London')
console.log( date.get() )
console.log( date.get('UTC') )
console.log( date.get('Americas/New_York') )

Options

  • timezone : Locale to override (Default is the initialized locale)
1.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago