https://github.com/jojoee/date-timezones
:date: Return native "Date" object with specific timezone (e.g. new DateTimezones('Australia/Sydney'))
https://github.com/jojoee/date-timezones
date time timezone zone
Last synced: 8 months ago
JSON representation
:date: Return native "Date" object with specific timezone (e.g. new DateTimezones('Australia/Sydney'))
- Host: GitHub
- URL: https://github.com/jojoee/date-timezones
- Owner: jojoee
- License: mit
- Created: 2017-02-27T15:27:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-18T09:40:10.000Z (over 7 years ago)
- Last Synced: 2025-04-07T01:07:20.047Z (about 1 year ago)
- Topics: date, time, timezone, zone
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# date-timezones
[](https://travis-ci.org/jojoee/date-timezones)
[](https://codecov.io/github/jojoee/date-timezones)
[](https://www.npmjs.com/package/date-timezones)
[](https://bower.io/search/?q=date-timezones)
[](http://opensource.org/licenses/MIT)
[](https://github.com/semantic-release/semantic-release)
Return native "Date" object with specific timezone (e.g. new DateTimezones('Australia/Sydney'))
## Installation
```
// npm
npm install date-timezones
// Bower
bower install date-timezones
// then see this example file
// https://github.com/jojoee/date-timezones/blob/master/index.html
```
## Example usage
```javascript
// Tue Feb 28 2017 00:20:47 GMT+0700 (SE Asia Standard Time)
var local = DateTimezones();
// Tue Feb 28 2017 00:20:47 GMT+0700 (SE Asia Standard Time)
var bangkok = DateTimezones('Asia/Bangkok');
// Tue Feb 28 2017 01:20:47 GMT+0700 (SE Asia Standard Time)
var shanghai = DateTimezones('Asia/Shanghai');
// Mon Feb 27 2017 17:20:47 GMT+0700 (SE Asia Standard Time)
var london = DateTimezones('Europe/London');
```
## Future update
- [x] Test
- [x] Code coverage
- [ ] Demo page
- [ ] Screenshot
- [x] Commit by `npm run commit` only
- [ ] Increase code coverage percentage
- [x] ESLint
- [ ] Automated scripts: auto update dependencies, cause it need to update DSL (Daylight Saving Time)
## Contribute for owner
```
$ npm install -g semantic-release-cli
$ semantic-release-cli setup
Using above command to setup "semantic-release"
```
## Reference
- [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
- [The World Clock](https://www.timeanddate.com/worldclock/)