PHP Dates and Times

Archived

This page has been archived and will receive no further updates.

Get current time as epoch timestamp

$now = time();

Get formatted current time

$now = date("Y-m-d H:i:s");

Convert epoch time to readable format

$time = date("Y-m-d H:i:s", $epoch);

Convert Microsoft’s FILETIME to epoch

$epoch = ($filetime / 10000000) - 11644473600;