Search

All tools
Laravel & PHP

PHP Date Format Cheatsheet

Look up PHP date format tokens and preview Carbon::parse($input)->format($format) live.

Wednesday 23 September 2026, 18:53

ISO 8601: 2026-09-23T18:53:50+00:00

Token Meaning Example
Y Four-digit year 2026
y Two-digit year 26
F Full month name September
M Short month name Sep
m Month, 01–12 09
n Month, 1–12 9
d Day of month, 01–31 23
j Day of month, 1–31 23
D Short weekday Wed
l Full weekday Wednesday
N ISO weekday 1–7 (Mon–Sun) 3
w Weekday 0–6 (Sun–Sat) 3
W ISO week number 39
z Day of year, 0–365 265
t Days in the month 30
L Leap year (1 or 0) 0
H Hour, 00–23 16
G Hour, 0–23 16
h Hour, 01–12 04
g Hour, 1–12 4
i Minutes, 00–59 47
s Seconds, 00–59 00
a am or pm pm
A AM or PM PM
P Timezone offset with colon +01:00
O Timezone offset without colon +0100
e Timezone identifier Europe/London
T Timezone abbreviation BST
U Unix timestamp 1789999999
c ISO 8601 datetime 2026-09-23T16:47:00+01:00
r RFC 2822 datetime Wed, 23 Sep 2026 16:47:00 +0100

Examples

How it works

PHP date() tokens are what Carbon::format() uses. Y is a four-digit year, m a zero-padded month, d a zero-padded day, H 24-hour time. ISO 8601 is c; RFC 2822 is r. Parse a datetime, pick a format string, and copy the result.

Related tools

Related reading

Your experience on this site will be improved by allowing cookies Cookie Policy