abhi_madhani Posted April 2, 2011 Share Posted April 2, 2011 Hi, I am trying to convert a String date into numeric date using PHP function's, but haven't found such function. Had a look at date(), strtotime(), getdate(); e.g. Apr 1 2011 -> 04-01-2011 Could someone please shed some light on this? Regards, Abhishek Link to comment https://forums.phpfreaks.com/topic/232487-convert-a-date-string-into-numeric-date/ Share on other sites More sharing options...
Genesis730 Posted April 2, 2011 Share Posted April 2, 2011 $datestring = "Apr 1 2011"; $new_date = date("m-d-Y", strtotime($datestring)); if you echo $new_date, it will show up 04-01-2011 Link to comment https://forums.phpfreaks.com/topic/232487-convert-a-date-string-into-numeric-date/#findComment-1195836 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.