GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing www.php.net — PHP: date - Manual date(PHP 4, PHP 5, PHP 7, PHP 8) date — Format a Unix timestamp Description
Returns a string formatted according to the given format string using the
given integer Warning
Unix timestamps do not handle timezones. Use the DateTimeImmutable class, and its DateTimeInterface::format() formatting method to format date/time information with a timezone attached. Parameters
Return ValuesReturns a formatted date string. Errors/Exceptions
Every call to a date/time function will generate an Changelog
Examples
Example #1 date() examples 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 #2 Escaping characters in date() Some examples of date() 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. Example #3 date() Formatting To format dates in other languages, IntlDateFormatter::format() can be used instead of date(). Notes
Tip
Timestamp of the start of the request is available in $_SERVER['REQUEST_TIME']. See Also
+add a note
User Contributed NotesThere are no user contributed notes for this page. | ||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |