Supplemental PHP DateTime formats documentation with live example dates and formatting.
I've been programming PHP for over a decade. The
date()
function has gone largely unchanged this entire time, yet I can never remember all the various formatting characters.I created this cheat sheet to combine documentation from the PHP Manual with handy reference tables and live example output.
I've provided a public repository of the source code for educational purposes – and because I love open-source. A hosted version of this guide is available on my website: https://jasongardner.co/php-date-cheat-sheet/
- Jason
To the extent possible under law, Jason Gardner has waived all copyright and related or neighboring rights to PHP DateTime Cheat Sheet. This work is published from: United States.
A portion of documentation text has been adapted or copied from the PHP Manual, which is provided under the terms of a Creative Commons Attribution 3.0 license by The PHP Group.
Cheat Sheet CSS code is adapted from stylesheets found on the PHP website.