date()
The date() function formats a timestamp into a readable date string.
Syntax
Section titled “Syntax”date(string $format, ?int $timestamp = null);If no timestamp is provided, the current time is used.
Example
Section titled “Example”echo date("Y-m-d");echo date("d/m/Y");Common Format Characters
Section titled “Common Format Characters”Y– Full yearm– Monthd– DayH– Houri– Minutess– Seconds