Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP date_format() Function

PHP date_format() Function

PHP Date/Time PHP Date/Time Reference Manual

Example

Return a new DateTime object and then format the date:

Run Example »


Definition and Usage

The date_format() function returns a date formatted according to a specified format.

Syntax

date_format(

object,format);

Parameters Description
object Required. Specifies a DateTime object returned by date_create() DateTime object returned by
format Required. Specifies the date format.

Technical Details

Return Value: Returns the formatted date string, or FALSE on failure.
PHP Version: 5.2+

PHP Date/Time PHP Date/Time Reference Manual