Unix Timestamp Converter for MySQL & PHP

Paste a timestamp (1760707200), milliseconds, an ISO date, or a MySQL value like 2026-10-17 14:30:00. Pick the time zone and copy the format you need.

FreeNo sign-upRuns in your browser: your data is not uploaded

Current Unix time: 0

What a Unix timestamp is

The number of seconds since 1 January 1970, 00:00 UTC. It has no time zone: 1760707200 is the same moment in Riyadh, Karachi and London. The time zone only matters when you turn it into a wall-clock date, which is where most bugs come from.

MySQL: DATETIME vs TIMESTAMP

DATETIMETIMESTAMP
StoresThe date and time exactly as givenUTC, converted from and to the session time zone
Range1000 to 99991970 to 2038-01-19
Changes if the server time zone changes?NoYes, on display

Laravel creates created_at and updated_at as TIMESTAMP and writes them in APP_TIMEZONE (UTC by default). If you see times off by exactly three or five hours, compare config/app.php timezone, PHP's date.timezone and MySQL's SELECT @@session.time_zone;. Keeping all three on UTC and converting only for display avoids almost all of it.

Converting in code

  • PHP: date('Y-m-d H:i:s', $ts) uses date_default_timezone_get(); strtotime('2026-10-17 14:30:00') goes the other way.
  • Laravel / Carbon: Carbon::createFromTimestamp($ts, 'Asia/Riyadh') and $date->timestamp.
  • MySQL: FROM_UNIXTIME(ts) and UNIX_TIMESTAMP(datetime), both in the session time zone.
  • JavaScript: Date.now() is in milliseconds. Divide by 1000 before sending it to PHP or MySQL. A 13-digit number is the giveaway; this page detects it automatically.

The 2038 problem, briefly

Signed 32-bit timestamps end on 19 January 2038. 64-bit PHP is fine, but MySQL's TIMESTAMP type stops there. For dates that may go past 2038, such as contract end dates or 15-year schedules, use DATETIME.

FAQ

Why is my converted time a few hours off?
The timestamp is right; the time zone used to display it is different. Pick the same zone here as your server or app (APP_TIMEZONE, date.timezone, MySQL time_zone) and the values will match.
Is the number in seconds or milliseconds?
10 digits is seconds (PHP, MySQL, Linux). 13 digits is milliseconds (JavaScript, Java). The converter tells you which one it read.
What does the page do with daylight saving time?
Time zones that use DST (Europe, US) are handled with your browser's time-zone database, the same data PHP uses. Saudi Arabia and Pakistan do not use DST, so the offset there is always +03:00 and +05:00.
How do I store a timestamp in MySQL?
Either as BIGINT with the raw number, or converted with FROM_UNIXTIME() into a DATETIME/TIMESTAMP column. Laravel's timestamps() uses TIMESTAMP columns.

Related guides

Found it useful? Put a link in your docs, README or forum answer so others can use it too:

HTML
<a href="https://headsntail.com/tools/unix-timestamp-converter">Unix Timestamp to Date Converter (MySQL, PHP)</a> (free, by HeadsNTail)
Markdown (GitHub, Stack Overflow, dev.to)
[Unix Timestamp to Date Converter (MySQL, PHP)](https://headsntail.com/tools/unix-timestamp-converter)

Need it done on your server? HeadsNTail sets up Laravel apps, cPanel hosting and migrations for businesses. See services or ask a question.