timezones-cli
v1.2.0
Published
A cli tool to convert a date or timestamp into different timezones.
Downloads
14
Maintainers
Readme
Usage
See: timezones-cli: How to Stay Sane Working With US Timezones
convert current datetime
$ npx timezones-cli
UTC 2017-09-14 03:13 PM
PST (-8:00) 2017-09-14 07:13 AM
PDT/MST (-7:00) 2017-09-14 08:13 AM Los Angeles, Phoenix
CST/MDT (-6:00) 2017-09-14 09:13 AM Denver
EST/CDT (-5:00) 2017-09-14 10:13 AM Chicago
EDT (-4:00) 2017-09-14 11:13 AM New Yorkconvert date in ISO-8601 format
$ npx timezones-cli 2016-12-14T04:40:44.248Z
UTC 2016-12-14 04:40 AM
PST (-8:00) 2016-12-13 08:40 PM Los Angeles
PDT/MST (-7:00) 2016-12-13 09:40 PM Phoenix, Denver
CST/MDT (-6:00) 2016-12-13 10:40 PM Chicago
EST/CDT (-5:00) 2016-12-13 11:40 PM New York
EDT (-4:00) 2016-12-14 12:40 AMconvert epoch timestamp
$ npx timezones-cli 1505880000000
UTC 2017-09-20 04:00 AM
PST (-8:00) 2017-09-19 08:00 PM
PDT/MST (-7:00) 2017-09-19 09:00 PM Los Angeles, Phoenix
CST/MDT (-6:00) 2017-09-19 10:00 PM Denver
EST/CDT (-5:00) 2017-09-19 11:00 PM Chicago
EDT (-4:00) 2017-09-20 12:00 AM New YorkInstallation
npm install timezones-cli --globalDevelopment
Running Tests
npm testCode Quality
npm run lint # Check for linting issues
npm run lint:fix # Auto-fix linting issues
npm run format # Format code with PrettierPublishing to npm
To update the package on npmjs.com:
Update the version in
package.json(this also creates a git tag automatically):npm version patch # for bug fixes (1.1.0 → 1.1.1) npm version minor # for new features (1.1.0 → 1.2.0) npm version major # for breaking changes (1.1.0 → 2.0.0)Publish to npm:
npm publishPush changes and tags to git:
git push origin main --tagsCreate GitHub Release (optional but recommended):
- Go to GitHub Releases
- Click "Create a new release"
- Select the tag created by
npm version - Add release title (e.g., "v1.2.0")
- Add release notes describing changes, new features, bug fixes
- Click "Publish release"
Note:
npm versionautomatically creates a git commit and tag- Make sure you're logged in to npm (
npm login) and have publish permissions for thetimezones-clipackage - GitHub releases provide better documentation and changelog for users
