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) * 24

Time Difference

offset_diff = diff

UTC Equivalent

utc_time = ((source_hour - source_offset) + 48) - floor(((source_hour - source_offset) + 48) / 24) * 24

Variables

VariableDescriptionDefault
source_hourSource Time (24hr)(hour)14
source_offsetSource UTC Offset(hours)-5
target_offsetTarget UTC Offset(hours)1
diffDerived value= target_offset - source_offsetcalculated

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

ZoneOffset PSTUTC-8 MSTUTC-7 CSTUTC-6 ESTUTC-5 GMT/UTCUTC+0 CETUTC+1 ISTUTC+5:30 JSTUTC+9

Worked Example

Convert 2:00 PM EST (UTC-5) to CET (UTC+1).

source_hour = 14source_offset = -5target_offset = 1
  1. 01Difference = +1 - (-5) = +6 hours
  2. 02Target time = 14 + 6 = 20:00 (8:00 PM CET)
  3. 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