PHP ManualDateTime::formatdate_format(PHP 5 >= 5.2.0) DateTime::format -- date_format — Returns date formatted according to given format DescriptionObject oriented style
public string DateTime::format
( string
$format
)Procedural style Returns date formatted according to given format. Parameters
Return Values
Returns the formatted date string on success or ExamplesExample #1 DateTime::format() example Object oriented style
<?php Procedural style
<?php The above example will output: 2000-01-01 00:00:00 NotesThis method does not use locales. All output is in English. See Also
![]() |
PHP-Index
New Tutorial entries
|