PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Currently in my table (in database), i store date record in 'dd.mm.yyyy' format. The problem is i don't know how to display that date in 'MMM dd, YYYY' format. i've tried all the way but still can't find the right way. Anybody can help me pls?
If i not mistake, that code will display the current date, right? But my prob is to convert the date record from database (in 'dd.mm.yyyy' format) to 'MMM dd, YYYY' format. For example, record in database is '20.05.2005'. I want to display that record as 'May 20, 2005'. Anybody can help?
$date = '02.06.2005';
$bits = explode('.', $date);
$date_stamp = strtotime($bits[1].'/'.$bits[0].'/'.$bits[2]); //Use a U.S. format for strtotime() [mm/dd/YYYY]
echo date("d M, Y", $date_stamp);
OK. Now the prob is solved already. Currently i'm using d11wtq's way. But just want to know, in php, can we convert the string to date? Just like we convert int to string..