Jump to content

[SOLVED] Display timestamp based on specific time zone


mfallon

Recommended Posts

I have the following code which displays when my users were last active.

 

$date   = date("d/m/y, H:i P ",mysql_result($result,$i,"users.timestamp"));

 

I have used the P switch to show the timezone difference as all users are located in GMT but the server is not (US EST to be specific) and I want to be able to see clearly when the user last logged on.

 

How can I get it to show the time in GMT?

 

Do I need to set the timezone in the code when I put the timestamp in to the database, and / or when I retrieve it?

 

I've been searching furiously for the information but can't find anything.

 

Thanks in advance for your help.

 

Matt Fallon

Thanks laffin, much better, the only issue I am left with is that the time shown does not include the fact that we are no under daylight savings, is there a way to specify the location instead of GMT so that daylight savings can be taken in to account.

 

Thanks, Matt

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.