CalculatorsLesson 181Free preview
Time Zone Converter
This lesson is part of Web Developer Tools · All levels
Summary
Time Zone Converter converts time from one time zone to another, taking into account offset and daylight saving time. The zone should be referred to as an IANA such as Asia/Jakarta or Europe/Berlin, rather than an abbreviation such as WIB or CET which can be ambiguous. When saving the time of the zone crossing, save it in UTC and display it according to the user zone.
Key points
- Use the IANA ID, for example Asia/Jakarta which is at UTC+7
- Offset can change due to daylight saving time
- Keep time in UTC to avoid confusion
- Zoning abbreviations can be ambiguous between countries
- Some local time may be lost or repeated during DST
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.