How to get the current UNIX timestamp using PHP

H

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

About the author

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.

About Author

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.

Follow Me