Interactive reference: test format strings, look up parameters, and try strtotime() expressions.
{{ dateResult }}
<?php echo date("{{ dateFormat }}"); ?>
| {{ __t('th_character') }} | {{ __t('th_description') }} | {{ __t('th_example') }} | |
|---|---|---|---|
| {{ group.title }} | |||
{{ p.char }} |
{{ p.desc }} | {{ getParamExample(p.char) }} | |
{{ strtotimeResult.timestamp }}
{{ strtotimeResult.formatted }}
{{ strtotimeResult.relative }}
{{ strtotimePhpCode }}
| {{ __t('th_expression') }} | {{ __t('th_description') }} | {{ __t('label_result') }} |
|---|---|---|
{{ ref.expr }} |
{{ ref.desc }} | {{ getStrtotimeExample(ref.expr) }} |
The function date(string $format, ?int $timestamp = null) formats a Unix timestamp or the current time into a readable string. The format string consists of placeholders like Y (four-digit year), m (month with leading zero), d (day) or H:i:s (hours:minutes:seconds in 24h format).
strtotime(string $datetime, ?int $baseTimestamp = null) converts English text descriptions into Unix timestamps. Typical inputs: "now", "+1 day", "next monday", "first day of next month", "last day of december 2025". The function is extremely flexible and also understands combined expressions like "+2 weeks 3 days".
date("Y-m-d") — ISO date: 2025-03-15date("d.m.Y") — German format: 15.03.2025date("Y-m-d H:i:s") — MySQL Datetimedate("c") — ISO 8601: 2025-03-15T14:30:00+01:00date("r") — RFC 2822: Sat, 15 Mar 2025 14:30:00 +0100date("U") — Unix timestamp