Jump to content

gmmktime timestamp converted to EST - easy right?


linus72982

Recommended Posts

Everywhere I look for an answer to this there is a page and a half explanation about time zones and DST and different functions and unix epochs, gah.  I made a login script that logs the gmmktime of when the user registered and there are now a bunch of members so I can't just go change the script, I definitely need a way to convert these timestamps to the date AND time that the timestamp was set, preferably in an easy to use way such as an array with "month" "day" "year" AND "time" in EST.  Does anyone know of a way to do this?  Every one I come across either converts it to just a date or to just grabs the time and makes it super confusing as to what it is converting to and questions what arguments were sent with gmmktime when it was set (hint: none were sent with it.)

 

Thanks for any help.

Link to comment
Share on other sites

I really dont know of a good way to do this... what i would do is convert it to a unix time stamp and then find out how much each timezone is off from my current time zone. So like if my current time of my server is 1300103485 and i know the next timezone over is an hour less so 1 hour converted to seconds is 3600 seconds. 1300103485 - 3600 = 1300099885. That converts from unix time stamp to: Mon, 14 Mar 2011 10:51:25 GMT. There is probably a more effective way to do it but thats all I got.

Link to comment
Share on other sites

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.