shane07 Posted January 10, 2008 Share Posted January 10, 2008 Hello I want to add 5 hours and 45 minutes to "date". How can it be done? For example I have $currentdate=date("Y-m-d"); But it doesn't give my local date. It gives the server's date. So I want to add certain hours to date. Thanx in advance Link to comment https://forums.phpfreaks.com/topic/85400-how-can-i-add-hours-to-date/ Share on other sites More sharing options...
interpim Posted January 10, 2008 Share Posted January 10, 2008 add 3600 (secs) for each hour you want to adjust... or subtract if you want to go back from your server timestamp Link to comment https://forums.phpfreaks.com/topic/85400-how-can-i-add-hours-to-date/#findComment-435733 Share on other sites More sharing options...
Zane Posted January 10, 2008 Share Posted January 10, 2008 $currentdate=date("Y-m-d", strtotime("+ 5 hours 45 minutes"); Link to comment https://forums.phpfreaks.com/topic/85400-how-can-i-add-hours-to-date/#findComment-435749 Share on other sites More sharing options...
shane07 Posted January 10, 2008 Author Share Posted January 10, 2008 $currentdate=date("Y-m-d", strtotime("+ 5 hours 45 minutes"); Thank You for ur reply Link to comment https://forums.phpfreaks.com/topic/85400-how-can-i-add-hours-to-date/#findComment-435756 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.