time-zone-convertor
v1.2.0
Published
A npm package for converting time into different time zone
Downloads
6
Readme
Time Zone Converter
A simple npm package for converting time between different time zones.
Installation
Install the package via npm:
npm install time-zone-convertor
// Use the DateTimeConverter module to convert to all time zones
const DateTimeConverter = require('time-zone-convertor');
const dateTime = '2024-03-09 12:00:00';
const fromTimeZone = 'America/New_York';
const toTimeZone = 'UTC';
const format = 'YYYY-MM-DD HH:mm:ss';
const convertedDateTime = DateTimeConverter.convertToAllTimeZones(dateTime, fromTimeZone, toTimeZone, format);
console.log(`Converted time to ${toTimeZone}:`, convertedDateTime);
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.