PHP Adding 15 minutes to Time value

后端 未结 7 2238
一整个雨季
一整个雨季 2020-11-27 07:35

I have a form that receives a time value:

$selectedTime = $_REQUEST[\'time\'];

The time is in this format - 9:15:00 - which is 9:15am. I t

7条回答
  •  独厮守ぢ
    2020-11-27 07:42

    strtotime returns the current timestamp and date is to format timestamp

      $date=strtotime(date("h:i:sa"))+900;//15*60=900 seconds
      $date=date("h:i:sa",$date);
    

    This will add 15 mins to the current time

提交回复
热议问题