Alith7 Posted September 6, 2007 Share Posted September 6, 2007 I need to return a timestamp from my DB with just the time, however, the script that is inputting the timestamp is from a different timezone and hour ahead of me. I need to return the time less one hour so that it reads right. This is the script that I have right now: $string .= date('h:i:s a',$coord[0]['time']).'<br>'; I know I need to put the SUBDATE function in there somehow, I'm just not able to figure out where. any ideas? Link to comment https://forums.phpfreaks.com/topic/68221-solved-help-with-timestamp/ Share on other sites More sharing options...
thedarkwinter Posted September 6, 2007 Share Posted September 6, 2007 what format is $coord[0]['time'] in? you can use time() - 3600 to lose an hour, so if its in a unix timestamp you can do the same <?php $string .= date('h:i:s a', (time()-6400)); $string .= date('h:i:s a',($coord[0]['time']-3600)); cheers, tdw Link to comment https://forums.phpfreaks.com/topic/68221-solved-help-with-timestamp/#findComment-342955 Share on other sites More sharing options...
Alith7 Posted September 6, 2007 Author Share Posted September 6, 2007 That worked! thank you so much for the quick reply! Link to comment https://forums.phpfreaks.com/topic/68221-solved-help-with-timestamp/#findComment-342961 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.