Home/Tools/PHP Timestamp Converter

PHP Date Tools

PHP Timestamp Converter

Convert Unix timestamps to UTC, local time, and PHP date examples.

Converted date

UTC: 2024-07-01T08:00:00.000Z
Local: Mon Jul 01 2024 16:00:00 GMT+0800
PHP date example: date('Y-m-d H:i:s', 1719820800)

Paste a Unix timestamp to see the equivalent UTC time, local browser time, and a PHP date() example.

PHP timestamp basics

PHP timestamps usually represent seconds since January 1, 1970 UTC. When comparing with JavaScript, remember that JavaScript uses milliseconds.

PHP example

date_default_timezone_set('UTC');
echo date('Y-m-d H:i:s', 1719820800);

Common mistakes

Passing a JavaScript millisecond timestamp into PHP without dividing by 1000 will produce a date far in the future.

FAQ

Does PHP use seconds or milliseconds?

PHP Unix timestamps are normally seconds. JavaScript Date values use milliseconds.

Why does local time differ from UTC?

Local time depends on your browser timezone. Server-side PHP depends on the configured timezone.

Related tools

Related guides