casperpaul Posted May 4, 2007 Share Posted May 4, 2007 Hi, I have a string and time conversion question: How can I go about converting a string in the GMT format Fri, 04 May 2007 19:57:14 GMT to an EST format such as Fri, 04 May 2007 2:57pm EST ??? So is there a way I can always extract the portion 19:57:14 GMT ---> x:xxam EST Thanks, Paul Link to comment https://forums.phpfreaks.com/topic/50054-solved-convert-gmt-string-to-est-output/ Share on other sites More sharing options...
casperpaul Posted May 6, 2007 Author Share Posted May 6, 2007 Any hints? I'm thinking ... extract the 19:57:14 portion of the string and just subtract 5 hours from the 19 part ... but suppose it's 03:57:14 ==> it would be a negative result. Any simpler or programmer's way or implementing a function? Thanks, Paul Link to comment https://forums.phpfreaks.com/topic/50054-solved-convert-gmt-string-to-est-output/#findComment-246399 Share on other sites More sharing options...
SkyRanger Posted May 6, 2007 Share Posted May 6, 2007 You can try using this: date_default_timezone_set('EST'); I converts all my date() from GMT to EST Just place it at the top of your page. Link to comment https://forums.phpfreaks.com/topic/50054-solved-convert-gmt-string-to-est-output/#findComment-246402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.