date

PHP 4, PHP 5, PHP 7, PHP 8
date - Format a local time/date
Date Online Tool
Manual
Code Examples

Example #1 Escaping characters in 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.

PHP Version:

Example #2 date examples

PHP Version:

Example #3 date and mktime example

together to find dates in the future or the past.

PHP Version:

Example #4 date Formatting

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.

PHP Version:


Example #5 of date

PHP Version:


Function date:

Date and Time Functions

Most used PHP functions