unix timestamp to datetime php not working code example Example: php unix timestamp to date $currentTime = DateTime::createFromFormat( 'U', $timestamp );