Time Zone Converter: how it works and how to build one
Convert a time between cities and plan meetings. This guide explains what happens behind the button and shows the code, so you can build your own.
What it does
Pick a date and time in one city and see it in others, with daylight saving handled. Add the cities your team works in and find hours that suit everyone.
When to use it
- Scheduling meetings across countries
- Event announcements
- Remote team planning
How to use it
- Set the date, time and your city.
- Add other cities.
- Copy the times for your invite.
Try it free in your browser, nothing is uploaded: https://eskillsfy.com/tools/time-zone-converter
How it works
The browser includes the full IANA time-zone database. Intl.DateTimeFormat with a timeZone option shows any instant in any city, with daylight saving handled.
The tricky part is the input: ’10:00 in London’ must become a UTC instant. The tool guesses the UTC time, measures the zone’s offset at that moment with formatToParts, and corrects once more around DST changes.
Build it yourself
Here is the core of the tool. It has no dependencies unless noted, so you can paste it into any TypeScript or JavaScript project.
timezones.ts (ts)
export function zoneOffsetMs(utcMs: number, timeZone: string) {
const p = Object.fromEntries(new Intl.DateTimeFormat("en-US", { timeZone, hourCycle: "h23", year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit" })
.formatToParts(utcMs).map((x) => [x.type, x.value]));
return Date.UTC(+p.year, +p.month - 1, +p.day, +p.hour, +p.minute) - utcMs;
}
// Wall-clock time in a zone → UTC
export function toUtc(y: number, mo: number, d: number, h: number, mi: number, zone: string) {
const guess = Date.UTC(y, mo - 1, d, h, mi);
return guess - zoneOffsetMs(guess - zoneOffsetMs(guess, zone), zone);
}
new Date(toUtc(2026, 11, 23, 10, 0, "Asia/Kolkata")).toLocaleString("en-GB", { timeZone: "Europe/London" });
Make it production-ready
- Highlight overlapping working hours across all cities.
Questions
Does it handle daylight saving?
Yes. It uses your browser’s time zone database, which knows the DST rules.
Free, runs in your browser, nothing is uploaded.