DateTime::formatDateTimeImmutable::formatDateTimeInterface::formatdate_formatReturns date formatted according to given format DescriptionObject oriented style
public string DateTime::format
( string
$format
)
public string DateTimeImmutable::format
( string
$format
)
public string DateTimeInterface::format
( string
$format
)Procedural style
string date_format
( DateTimeInterface
$object
, string $format
)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
|