prakash Posted February 19, 2009 Share Posted February 19, 2009 Hi, When I use following code <?php print date("Y-m-d", strtotime("24 Dec, 2008")); ?> it display wrong year. how can I solve this problem? Link to comment https://forums.phpfreaks.com/topic/145884-solved-problem-on-using-strtotime/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 19, 2009 Share Posted February 19, 2009 That is not a format that the strtotime() function understands - http://www.gnu.org/software/tar/manual/html_node/Calendar-date-items.html#SEC116 Link to comment https://forums.phpfreaks.com/topic/145884-solved-problem-on-using-strtotime/#findComment-765931 Share on other sites More sharing options...
prakash Posted February 19, 2009 Author Share Posted February 19, 2009 That is not a format that the strtotime() function understands - http://www.gnu.org/software/tar/manual/html_node/Calendar-date-items.html#SEC116 then is there any option to convert the date? Link to comment https://forums.phpfreaks.com/topic/145884-solved-problem-on-using-strtotime/#findComment-765932 Share on other sites More sharing options...
PFMaBiSmAd Posted February 19, 2009 Share Posted February 19, 2009 You would need to parse the date (explode) into its parts and rearrange it into a format that works. Where is the date coming from? And if you are putting it into a mysql database, you can use the mysql STR_TO_DATE() function in a query. Link to comment https://forums.phpfreaks.com/topic/145884-solved-problem-on-using-strtotime/#findComment-765938 Share on other sites More sharing options...
prakash Posted February 19, 2009 Author Share Posted February 19, 2009 when I remove the "," from the date value then it works. thanks Link to comment https://forums.phpfreaks.com/topic/145884-solved-problem-on-using-strtotime/#findComment-765941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.