PHP date() formats a timestamp using a token string. Each character has meaning, so small mistakes can change the output.
Common tokens
Yfour digit yearmtwo digit monthdtwo digit dayH24-hour houriminutessseconds
Code examples
echo date('Y-m-d');
echo date('Y-m-d H:i:s');
echo date(DATE_ATOM);
Common errors
Use i for minutes. m is month. Set date_default_timezone_set() or configure date.timezone so output is predictable.
Related tool
Try the PHP Date Format Tester.