mescal Posted April 5, 2007 Share Posted April 5, 2007 Hi, I need to increase a given date and time (by a flat text) with 30 seconds(incremental) on each item coming from my database. exmpl: item1 date Apr 24, 2007 19:00:00 item2 date Apr 24, 2007 19:00:30 item3 date Apr 24, 2007 19:01:00 someone got an idea? thx in advance Eric ??? Link to comment https://forums.phpfreaks.com/topic/45688-increase-date-and-time/ Share on other sites More sharing options...
jitesh Posted April 5, 2007 Share Posted April 5, 2007 SELECT DATE_ADD(datetimefeild,INTERVAL 30 SECOND); OR SELECT datetimefeild + INTERVAL 30 SECOND Link to comment https://forums.phpfreaks.com/topic/45688-increase-date-and-time/#findComment-221928 Share on other sites More sharing options...
mescal Posted April 5, 2007 Author Share Posted April 5, 2007 but that is mysql ,right? i need it in PHP thx Link to comment https://forums.phpfreaks.com/topic/45688-increase-date-and-time/#findComment-221929 Share on other sites More sharing options...
jitesh Posted April 5, 2007 Share Posted April 5, 2007 Try this echo date("Y-m-d H:i:s", mktime($hour,$min, $sec, $mon, $day, $year) + 30); Link to comment https://forums.phpfreaks.com/topic/45688-increase-date-and-time/#findComment-221932 Share on other sites More sharing options...
mescal Posted April 5, 2007 Author Share Posted April 5, 2007 will that be something like? date("Mar 24, 2007 19:00:00", mktime($hour,$min, $sec, $mon, $day, $year) + 30); Link to comment https://forums.phpfreaks.com/topic/45688-increase-date-and-time/#findComment-221945 Share on other sites More sharing options...
jitesh Posted April 5, 2007 Share Posted April 5, 2007 date("F j, Y, g:i a", mktime($hour,$min, $sec, $mon, $day, $year) + 30); Link to comment https://forums.phpfreaks.com/topic/45688-increase-date-and-time/#findComment-221966 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.