Setup time:
<?php$date=date_create("2013-05-01");date_time_set($date,13,24);echo date_format($date,"Ymd H:i:s");?>The date_time_set() function is used to set the time.
date_time_set( object,hour,minute,second);
parameter | describe |
---|---|
object | Required. Specifies a DateTime object returned by date_create(). |
hour | Required. The hour in the specified time. |
minute | Required. Minutes in a specified time. |
second | Optional. Seconds in the specified time. Default is 0. |
Return value: | If successful, a DateTime object is returned. Returns FALSE on failure. |
---|---|
PHP version: | 5.2+ |
Update log: | PHP 5.3.0: Return value changed from NULL to DateTime. |