Socket
Socket
Sign inDemoInstall

is-dst

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-dst

Is it Daylight Saving Time?


Version published
Weekly downloads
229
increased by77.52%
Maintainers
1
Install size
2.58 kB
Created
Weekly downloads
 

Readme

Source

is-dst Build Status

Checks if local clocks are currently adjusted for daylight saving time. :sunny:

Install

Install with yarn:

$ yarn add is-dst

Or with npm:

$ npm install --save is-dst

Usage

const isDST = require('is-dst')

/*
 * Examples invoked on February 5th, 2017 in US/Eastern timezone
 */

isDST(new Date('January 1, 2017'))
//=> false

isDST(new Date('July 1, 2017'))
//=> true

isDST()
//=> false

API

isDST([,date])

date

Type: Date
Default: new Date()

The date to check for DST.

Assumptions

  • Returns false for time zones that do not observe DST.

  • Assumes that January 1st and July 1st will never both be DST or not DST in a given year. This is currently true for all time zones that observe DST.

License

MIT © Brandon Smith

Keywords

FAQs

Last updated on 07 Aug 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc