New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

shitty-date

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shitty-date

manage dates by timezones

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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)

FAQs

Package last updated on 04 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts