woolyg Posted September 10, 2007 Share Posted September 10, 2007 Hi, I have data that's output from my db in the form Sunday 9th September 2007 21:29:22. I'm getting it by using <?php $timestamp= $row['timestamp']; echo date('l jS F Y H:i:s', strtotime($timestamp)); ?> I'd like to add 19 hours to it, but have no idea how to. Anyone help? Cheers, Woolyg Quote Link to comment https://forums.phpfreaks.com/topic/68657-problem-with-strtotime/ Share on other sites More sharing options...
Clinton Posted September 10, 2007 Share Posted September 10, 2007 Here's an example I use on my site: $ztime = date("H:i d-M-y", strtotime("now + 6 hour")); Quote Link to comment https://forums.phpfreaks.com/topic/68657-problem-with-strtotime/#findComment-345141 Share on other sites More sharing options...
woolyg Posted September 10, 2007 Author Share Posted September 10, 2007 I'm not sure this relates to what I wanna do - I'm not changing the date of 'now' - I need to change the displayed time of a date that is being pulled from a database query.. Quote Link to comment https://forums.phpfreaks.com/topic/68657-problem-with-strtotime/#findComment-345143 Share on other sites More sharing options...
Clinton Posted September 10, 2007 Share Posted September 10, 2007 replace my now with your $timestamp. <?php $timestamp= $row['timestamp']; echo date('l jS F Y H:i:s', strtotime("$timestamp + 19 hour")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/68657-problem-with-strtotime/#findComment-345144 Share on other sites More sharing options...
woolyg Posted September 10, 2007 Author Share Posted September 10, 2007 Ahh. Thanks very much hunna03 - I see the light! Cheers - Woolyg. Quote Link to comment https://forums.phpfreaks.com/topic/68657-problem-with-strtotime/#findComment-345149 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.