chelnov63 Posted September 2, 2008 Share Posted September 2, 2008 Hi Im recieving imformation from an rss feed which has the date in the format: Mon, 01 Sep 2008 09:48:00 PST I needed to convert this into the format dd/mm/yy so the above would look like: 01/09/08 does php have any built in functions so i can do this? thanks in advance Link to comment https://forums.phpfreaks.com/topic/122366-format-from-mon-01-sep-2008-094800-pst-to-ddmmyy/ Share on other sites More sharing options...
tmbrown Posted September 2, 2008 Share Posted September 2, 2008 should be as simple as date("d/m/y",$yourvar); See http://us.php.net/manual/en/function.date.php for more info Link to comment https://forums.phpfreaks.com/topic/122366-format-from-mon-01-sep-2008-094800-pst-to-ddmmyy/#findComment-631846 Share on other sites More sharing options...
chelnov63 Posted September 2, 2008 Author Share Posted September 2, 2008 thanks but i dont think php recognises that format as a date format? It accepts mySQL timestamps fine as I did that earlier on but with: $yourvar = "Mon, 01 Sep 2008 09:48:00 PST"; echo date("d/m/y",$yourvar); I get the error: Warning: date() expects parameter 2 to be long, string given in C:\htdocs\test.php on line 3 Link to comment https://forums.phpfreaks.com/topic/122366-format-from-mon-01-sep-2008-094800-pst-to-ddmmyy/#findComment-631863 Share on other sites More sharing options...
chelnov63 Posted September 2, 2008 Author Share Posted September 2, 2008 cool it does recognize it.. i use strtotime ..did the trick..thanks Link to comment https://forums.phpfreaks.com/topic/122366-format-from-mon-01-sep-2008-094800-pst-to-ddmmyy/#findComment-631864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.