PHPDateTimedate

Formats a Unix timestamp as a date/time string.

Syntax

date(string $format, ?int $timestamp): string

Example

Enter values below to update the example in real time.

echo
strtotime
echo date("Y-m-d");                         // 2026-06-28
echo date("Y-m-d", strtotime("+7 days"));  // 일주일 후