xtz.js is a fast, lightweight, dependency-free library for translation between timezones and UTC with the native Intl.DateTimeFormat format at ~100 LoC. For Node.js and browsers.
time converter calculator, utc to local time converter, time conversion chart, world time converter, time zone converter classic, time difference calculator
How to make use of it:
1. Insert the JavaScript xtz.js
into the HTML doc.
<script src="./xtz.js"></script>
2. Initialize.
var XTZ = window.XTZ;
3. Convert Relative TimeZone to Absolute UTC.
// toUTC(dtString, timeZone) XTZ.toUTC("2021-06-03 12:52:46.007", "Asia/Shanghai") .toISOString() // => 2021-06-03T12:52:46.007+0800 // OR // toUTCISOString(dtString, timeZone) XTZ.toUTCISOString("2021-06-03 12:52:46.007", "Asia/Shanghai") // => 2021-06-03T12:52:46.007+0800
4. Convert Absolute UTC to Relative TimeZone.
// toTimeZone(utcDate, timeZone) XTZ.toTimeZone("2021-06-03T04:50:36.715Z", "Asia/Shanghai") .toISOString() // => 2021-06-03T12:50:36.715+0800 // OR // toTimeZoneISOString(isoString, timeZone) XTZ.toTimeZoneISOString("2021-06-03T04:50:36.715Z", "Asia/Shanghai") // => 2021-06-03T12:50:36.715+0800
Time Zones And UTC Converter, xtz.js Plugin/Github
See Demo And Download
Official Website(therootcompany): Click Here
This superior jQuery/javascript plugin is developed by therootcompany. For extra Advanced Usages, please go to the official website.