https://github.com/brandon93s/is-dst
Is it Daylight Saving Time?
https://github.com/brandon93s/is-dst
daylight-savings dst time
Last synced: 4 months ago
JSON representation
Is it Daylight Saving Time?
- Host: GitHub
- URL: https://github.com/brandon93s/is-dst
- Owner: brandon93s
- License: mit
- Created: 2017-08-06T21:58:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T22:50:38.000Z (almost 3 years ago)
- Last Synced: 2025-06-11T18:27:58.610Z (4 months ago)
- Topics: daylight-savings, dst, time
- Language: JavaScript
- Size: 130 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: license
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# is-dst [](https://travis-ci.org/brandon93s/is-dst)
> Checks if local clocks are currently adjusted for [daylight saving time](https://en.wikipedia.org/wiki/Daylight_saving_time "Daylight Saving Time"). :sunny:
## Install
Install with yarn:
```shell
$ yarn add is-dst
```
Or with npm:
```shell
$ npm install --save is-dst
```## Usage
```js
const isDST = require('is-dst')/*
* Examples invoked on February 5th, 2017 in US/Eastern timezone
*/isDST(new Date('January 1, 2017'))
//=> falseisDST(new Date('July 1, 2017'))
//=> trueisDST()
//=> 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](https://github.com/brandon93s)