linus72982 Posted March 15, 2011 Share Posted March 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/230662-gmmktime-timestamp-converted-to-est-easy-right/ Share on other sites More sharing options...
vicodin Posted March 15, 2011 Share Posted March 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/230662-gmmktime-timestamp-converted-to-est-easy-right/#findComment-1187619 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.