shitty-date
1.1.0 • Public • Published Locale dates
const DATE = require(`shitty-date`)
const date = DATE('America/Toronto')
let locale = date.get()
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)
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.1.0
1
Version History
Package Sidebar
Install
Weekly Downloads