steveclondon Posted February 6, 2007 Share Posted February 6, 2007 Hi I have a string time in my database that I want to convert into a time for use in RSS. The format I have is 20070206095354 which is yyyy dd mm hh mm ss I want to convert to this format Mon, 15 Aug 2005 15:52:01 UTC Also my server is one hour ahead of GMT so I want to take that into account. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 6, 2007 Share Posted February 6, 2007 its its a string your storing: youd have to explode or something, i dont know if its a timstamp ( it better be ) $timestamp; echo strtime(hh dd mm ) etc its off the top of my head, but investigate the time and date functions good luck Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 6, 2007 Share Posted February 6, 2007 like this? <?php $date = "20070206095354"; echo date("D, d M Y H:i:s", strtotime($date)); ?> Quote Link to comment Share on other sites More sharing options...
steveclondon Posted February 6, 2007 Author Share Posted February 6, 2007 I have split my time. The main bit im stuck on is how to tell what day that date was. Quote Link to comment Share on other sites More sharing options...
steveclondon Posted February 6, 2007 Author Share Posted February 6, 2007 I have also converted the date and time to a unix timestamp. So i just need to know the day either from that timestamp or the above string time. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 6, 2007 Share Posted February 6, 2007 did you see my post above. the code i posted works. for me anyway. Quote Link to comment Share on other sites More sharing options...
steveclondon Posted February 6, 2007 Author Share Posted February 6, 2007 No i get a date in 1970 for that instead of 2007. Strange hey Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 6, 2007 Share Posted February 6, 2007 that is strange, because it works fine for me. 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.