PHP 4, PHP 5, PHP 7, PHP 8
date - Format a local time/date
You can prevent a recognized character in the format string from being expanded by escaping it with a preceding backslash. If the character with a backslash is already a special sequence, you may need to also escape the backslash.
Example #1 Escaping characters in date
Example #2 date examples
together to find dates in the future or the past.
Example #3 date and mktime example
formatting. Note that you should escape any other characters, as any which currently have a special meaning will produce undesirable results, and other characters may be assigned meaning in future PHP versions. When escaping, be sure to use single quotes to prevent characters like \n from becoming newlines.