date

string date(string format, [int time]) 
format Format in which to display the calculated date
time Time in UNIX time format

Formats a UNIX timestamp into a human-readable string.

Returns:

Formatted date output

Description:

date() displays a date in the format specified in the format argument. Dates and times can be displayed in any order and combination, with any delimiters.An optional second argument can be used to format the date from a specific time. If the second argument is omitted, the current time is used.

This function uses single characters as format specifiers; if you want to put other text directly into the format string, use strftime() instead. Otherwise, you could get unexpected results as characters from the text are converted ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.