PHP date_time_set() Function

PHP date_time_set Function


Definition : 

In php  date_time_set() Function is inbuilt function.PHP date_time_set() function is used to sets the time value. It sets the current time of the DateTime object to a different time. It accepts five different parameters. It returns the DateTime object on success or False on failure.

Syntax : 

   date_time_set(object, hour, minute, second, microseconds)

Parameter
Parameter Description
object Required. Specifies a DateTime object returned by date_create()
hour Required. Specifies the hour of the time
minute Required. Specifies the minute of the time
second Optional. Specifies the second of the time. Default is 0
microseconds Optional. Specifies the microsecond of the time. Default is 0

 Given below example date_time_set() function sets the time.

Output : 2014-03-02 14:28:00
               2014-03-02 11:10:30