MySQL UTC to Local Time Converter
Convert MySQL UTC timestamps to your local timezone instantly. Supports DATETIME, TIMESTAMP, DATE formats with batch conversion and multiple output formats.
About
MySQL stores TIMESTAMP columns in UTC internally, converting them on read based on the session time_zone variable. When you extract raw data via dumps, APIs, or direct queries with @@session.time_zone set to +00:00, every value arrives stripped of local context. Displaying these values to end users without conversion produces errors ranging from incorrect appointment times to broken audit trails. This tool parses MySQL DATETIME and TIMESTAMP string formats, interprets them as UTC, and converts to the client's detected local timezone using the browser's Intl.DateTimeFormat API, which correctly handles Daylight Saving Time transitions. It does not approximate offsets with a fixed number.
Batch mode accepts multiple timestamps separated by newlines, processing each independently. The output format is configurable: ISO 8601, locale-aware human-readable, Unix epoch (seconds and milliseconds), and relative time. Note: this tool assumes the input is UTC. If your MySQL server uses a non-UTC time_zone setting, the input is not truly UTC and the conversion will be offset by the difference. Pro Tip: always verify your source timezone with SELECT @@global.time_zone, @@session.time_zone; before trusting raw timestamp exports.
Formulas
The conversion from a UTC timestamp string to local time follows this process. The MySQL UTC string is parsed into a JavaScript Date object representing the absolute moment in time:
Where TUTC is the Unix epoch milliseconds of the input interpreted as UTC, and Δoffset is the local timezone offset in milliseconds, which varies with DST. The browser computes this internally via the IANA timezone database.
For Unix epoch output:
Where TUTC is the Date.getTime() value in milliseconds since 1970-01-01T00:00:00Z. The relative time calculation computes Δt = now − TUTC and selects the appropriate human-readable unit (seconds, minutes, hours, days, months, years) based on magnitude thresholds.
Reference Data
| MySQL Type | Storage | Range | UTC Behavior | Format |
|---|---|---|---|---|
| DATETIME | 8 bytes | 1000-01-01 to 9999-12-31 | Stores as-is (no conversion) | YYYY-MM-DD HH:MM:SS |
| TIMESTAMP | 4 bytes | 1970-01-01 to 2038-01-19 | Stored as UTC, converted on read | YYYY-MM-DD HH:MM:SS |
| DATE | 3 bytes | 1000-01-01 to 9999-12-31 | No time component | YYYY-MM-DD |
| TIME | 3 bytes | −838:59:59 to 838:59:59 | Duration, not timestamp | HH:MM:SS |
| YEAR | 1 byte | 1901 to 2155 | No conversion | YYYY |
| Common Timezone Offsets from UTC | ||||
| UTC / GMT | +00:00 | London (winter), Reykjavik | ||
| CET | +01:00 | Berlin, Paris, Rome | ||
| EET | +02:00 | Helsinki, Athens, Cairo | ||
| MSK | +03:00 | Moscow, Istanbul | ||
| IST | +05:30 | India (Mumbai, Delhi) | ||
| CST (China) | +08:00 | Beijing, Singapore | ||
| JST | +09:00 | Tokyo, Seoul | ||
| AEST | +10:00 | Sydney (winter) | ||
| EST | −05:00 | New York (winter) | ||
| CST (US) | −06:00 | Chicago (winter) | ||
| MST | −07:00 | Denver (winter) | ||
| PST | −08:00 | Los Angeles (winter) | ||
| AKST | −09:00 | Anchorage (winter) | ||
| HST | −10:00 | Honolulu (no DST) | ||
| MySQL Timezone Functions | ||||
| NOW() | Returns current date/time in session timezone | |||
| UTC_TIMESTAMP() | Returns current UTC date/time | |||
| CONVERT_TZ() | Converts between named timezones: CONVERT_TZ(dt, from_tz, to_tz) | |||
| UNIX_TIMESTAMP() | Returns seconds since 1970-01-01 00:00:00 UTC | |||
| FROM_UNIXTIME() | Converts Unix epoch to DATETIME in session timezone | |||