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
| Zone | Offset | |---|---| | PST | UTC-8 | | MST | UTC-7 | | CST | UTC-6 | | EST | UTC-5 | | GMT/UTC | UTC+0 | | CET | UTC+1 | | IST | UTC+5:30 | | JST | UTC+9 |
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
Ready to run the numbers?
Open Timezone Offset Converter