Hello guys,
please help me with this, i have a software done in php,
[php]
Thank you
Hello guys,
please help me with this, i have a software done in php,
[php]
Thank you
have you looked at this ? http://stackoverflow.com/questions/660501/simplest-way-to-increment-a-date-in-php
[php]strtotime(‘now + 4 hours’[/php]
You were close
[php]date(‘F j, Y, h:i A’, strtotime(’+5 hours’, strtotime($row[‘created’])))[/php]
Another alternative
[php]date(‘F j, Y, h:i A’, (strtotime($created) + (3600 * 5)))[/php]
ohhoww… thankx alot m@tt, thank you, its working, and m@tt how to add minutes?? like what if i want to add +5.30 hours??
cogga, strtotime(‘now + 4 hours’) takes the existing time and adds to it. He wants to take an existing date and add hours to that. Either example that m@tt gave would yield the the same result.
Same thing, either use strtotime
[php]date(‘F j, Y, h:i A’, strtotime(’+5 hours 30 minutes’, strtotime($row[‘created’])))[/php]
Or add the seconds manually
[php]
// 60 * 60 * 6 = 6 hours
// 60 * 30 = 30 minutes
date(‘F j, Y, h:i A’, (strtotime($row[‘created’]) + (60 * 60 * 6) + (60 * 30)))
[/php]
thankx alot m@tt, you really helped me alot, thank you