Timezone Offset Converter Formula
Understand the math behind the timezone offset converter. Each variable explained with a worked example.
Formulas Used
Target Time (24hr)
target_hour = ((source_hour + diff) + 48) - floor(((source_hour + diff) + 48) / 24) * 24Time Difference
offset_diff = diffUTC Equivalent
utc_time = ((source_hour - source_offset) + 48) - floor(((source_hour - source_offset) + 48) / 24) * 24Variables
| Variable | Description | Default |
|---|---|---|
source_hour | Source Time (24hr)(hour) | 14 |
source_offset | Source UTC Offset(hours) | -5 |
target_offset | Target UTC Offset(hours) | 1 |
diff | Derived value= target_offset - source_offset | calculated |
How It Works
Timezone Conversion
Target Time = Source Time + (Target Offset - Source Offset)
If the result exceeds 24, subtract 24 (next day). If negative, add 24 (previous day).
Common UTC Offsets
Worked Example
Convert 2:00 PM EST (UTC-5) to CET (UTC+1).
source_hour = 14source_offset = -5target_offset = 1
- 01Difference = +1 - (-5) = +6 hours
- 02Target time = 14 + 6 = 20:00 (8:00 PM CET)
- 03UTC equivalent = 14 + 5 = 19:00 UTC
Frequently Asked Questions
What about daylight saving time?
DST shifts the UTC offset by 1 hour. EDT (US Eastern Daylight) is UTC-4, while EST (Standard) is UTC-5. Make sure to use the correct offset for the date in question.
What are half-hour timezones?
Some regions use UTC offsets of :30 or :45. India (IST) is UTC+5:30, Nepal is UTC+5:45, Newfoundland (Canada) is UTC-3:30.
Ready to run the numbers?
Open Timezone Offset Converter