PHP function of the day: time()

For day 10 of 21 in the “PHP Function of the day” series, I’m going to look at time(). It simply gets the number of seconds elapsed since the Unix Epoch.

Let’s take a look.


echo ‘It has been ‘.time().’ seconds since January 1 1970 00:00:00 GMT’;



See the output


This has pretty limited utility on it’s own but used with other functions, it can do useful things.

Leave a Reply

Your email address will not be published.