Man Page: datetimeinterface.format
Operating Environment: php
Section: 3
DATETIMEINTERFACE.FORMAT(3) 1 DATETIMEINTERFACE.FORMAT(3) DateTime::format - Returns date formatted according to given format Object oriented styleSYNOPSISpublic string DateTime::format (string $format)DESCRIPTIONstring DateTimeImmutable::format (string $format) string DateTimeInterface::format (string $format) Procedural style string date_format (DateTimeInterface $object, string $format) Returns date formatted according to given format.PARAMETERSo $object -Procedural style only: A DateTime object returned by date_create(3) o $format - Format accepted by date(3).RETURN VALUESReturns the formatted date string on success or FALSE on failure.EXAMPLESExample #1 DateTimeInterface.format(3) example Object oriented style <?php $date = new DateTime('2000-01-01'); echo $date->format('Y-m-d H:i:s'); ?> Procedural style <?php $date = date_create('2000-01-01'); echo date_format($date, 'Y-m-d H:i:s'); ?> The above example will output: 2000-01-01 00:00:00NOTESThis method does not use locales. All output is in English.SEE ALSOdate(3). PHP Documentation Group DATETIMEINTERFACE.FORMAT(3)
| Related Man Pages |
|---|
| datetime.settimestamp(3) - php |
| datetimeimmutable.gettimestamp(3) - php |
| datetime.format(3) - php |
| datetime.setdate(3) - php |
| datetimeinterface.format(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| Question about Paderabo date script |
| grep tomorrow's date |
| Renaming multiple files |
| Date format change in UNIX .dat file |
| Code to compare date |