How to get the current UNIX timestamp using PHP

Written by Ian Carnaghan · 9 sec read >

UNIX TIMESTAMPIs the time measured in seconds since the start of the Unix epoch “1 January 1970”

Use the PHP time function as per example below

echo time(); //Will print out the current timestamp
//OUTPUT: 1285365600

To read more about the time function click here

Last Updated On March 22, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

Notify of