Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.