Jump to content

Add 30min extra to time variable


arunpatal

Recommended Posts

Hi Arunpatal,

 

If you're looking to do something like that then I would highly recommend that you take a read of the PHP manual concerning the 'strtotime' function. This function will allow you to convert the time into a TIMESTAMP, to which you can then convert the TIMESTAMP to an extra 30 minutes by simply typing '+ 30 mins'. Below is an example, along with a link to the PHP manual concerning 'strtotime'.

$last_visited_time = strtotime('10:00');
$result = date("H:i", strtotime('+30 minutes', $last_visited_time));

You can read the PHP manual relating to this HERE.

 

Good luck, let us know the outcome.

 

Regards,

Jason Moore

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.