|
DateTime::setTimedate_time_setSets the time DescriptionObject oriented style
public DateTime DateTime::setTime
( int
$hour
, int $minute
[, int $second = 0
] )Procedural style
DateTime date_time_set
( DateTime
$object
, int $hour
, int $minute
[, int $second = 0
] )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: 2001-01-01 14:55:00 2001-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
|