ultrus Posted April 21, 2009 Share Posted April 21, 2009 Hello, I'm have a GMT timestamp created from a an rss feed that I need to convert to a local time. I was thinking about just subtracting the offset (MST -700). However, that changes depending on daylight savings correct? Any thoughts on how to convert? Thanks much! Quote Link to comment Share on other sites More sharing options...
rhodesa Posted April 21, 2009 Share Posted April 21, 2009 pass it to strtotime() to convert it to a timestamp...then you can use date() to reprint the date (and it will be in the timezone of the server)...example: <?php $ts = strtotime('2009-04-21 14:38:00 GMT'); print date('r',$ts); ?> Quote Link to comment Share on other sites More sharing options...
ultrus Posted April 21, 2009 Author Share Posted April 21, 2009 ah! How simple. But such a headache until you came along. Thanks much! I'm all set. Quote Link to comment 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.