PHP time() Function

PHP time Function


Definition :

In php time()  Function is inbuilt function. PHP time() function is used to get the current time measured in the number of seconds since the Unix Epoch. It does not accept any parameter value. It returns current time value which can be converted to the current date using date() function.

Syntax

   time()

Given below example return the current time as a Unix timestamp, then format it to a date:

Output : 1641548579
               2022-01-07