Jump to content

[SOLVED] help with Timestamp


Alith7

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.