sandbudd Posted May 4, 2009 Share Posted May 4, 2009 guys this is I am sure any easy fix. I have the database auto populate with date and time but when displayed it is 3 hours off...how do I add 3 hours to the output? It does display the correct date. <? echo $row['date']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/156771-solved-echo-date-time-off/ Share on other sites More sharing options...
thebadbad Posted May 4, 2009 Share Posted May 4, 2009 If it's in YYYY-MM-DD HH:MM:SS format, this should work: <?php echo date('Y-m-d H:i:s', strtotime("{$row['date']} + 3 hours")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/156771-solved-echo-date-time-off/#findComment-825556 Share on other sites More sharing options...
sandbudd Posted May 4, 2009 Author Share Posted May 4, 2009 worked like a charm...thanks Quote Link to comment https://forums.phpfreaks.com/topic/156771-solved-echo-date-time-off/#findComment-825560 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.