PHP ManualDateTime::setTimedate_time_set(PHP 5 >= 5.2.0) DateTime::setTime -- date_time_set — Sets the time DescriptionObject oriented style Procedural style Resets the current time of the DateTime object to a different time. Parameters
Return Values
Returns the DateTime object for method chaining or Changelog
ExamplesExample #1 DateTime::setTime() example Object oriented style
<?php Procedural style
<?php The above examples will output something similar to: 2000-01-01 14:55:00 2000-01-01 14:55:24 Example #2 Values exceeding ranges are added to their parent values
<?php The above example will output: 2001-01-01 14:55:24 2001-01-01 14:56:05 2001-01-01 15:05:24 2001-01-02 01:55:24 See Also
![]() |
PHP-Index
New Tutorial entries
|