Skip to content

date()

The date() function formats a timestamp into a readable date string.

date(string $format, ?int $timestamp = null);

If no timestamp is provided, the current time is used.

echo date("Y-m-d");
echo date("d/m/Y");
  • Y – Full year
  • m – Month
  • d – Day
  • H – Hour
  • i – Minutes
  • s – Seconds