is-dst
Checks if local clocks are currently adjusted for daylight saving time. ☀️
Install
Install with yarn:
$ yarn add is-dst
Or with npm:
$ npm install --save is-dst
Usage
const isDST = /* * Examples invoked on February 5th, 2017 in US/Eastern timezone */ //=> false //=> true //=> 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