jeet_0077 Posted February 13, 2008 Share Posted February 13, 2008 Hi I have a date on a variable as: $date = '2008-02-13 06:43:45' ;// ' Y-m-d h:i:s ' I want 30 minutes to be added with this output. Can some one help me in that; Quote Link to comment https://forums.phpfreaks.com/topic/90945-please-help-with-time-function/ Share on other sites More sharing options...
laffin Posted February 13, 2008 Share Posted February 13, 2008 gmdate("Y-m-d h:i:s",strtotime("+30 Minutes",strtotime($date))) or gmdate("Y-m-d h:i:s",strtotime($date)+(30*60)) the 1st is easier to understand the 2nd is faster Quote Link to comment https://forums.phpfreaks.com/topic/90945-please-help-with-time-function/#findComment-466109 Share on other sites More sharing options...
revraz Posted February 13, 2008 Share Posted February 13, 2008 Or INTERVAL 30 SECONDS since you are using MySQL DateTime. Quote Link to comment https://forums.phpfreaks.com/topic/90945-please-help-with-time-function/#findComment-466112 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.