DateTime::setTime

PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTime::setTime - Sets the time
Manual
Code Examples

Example #1 DateTime::setTime example

Result: 2001-01-01 14:55:00 2001-01-01 14:55:24
PHP Version:

Example #2 Values exceeding ranges are added to their parent values

Result: 2001-01-01 14:55:24 2001-01-01 14:56:05 2001-01-01 15:05:24 2001-01-02 01:55:24
PHP Version:


Function DateTime::setTime:

Date and Time Functions

Most used PHP functions