I have date in following format (Y-m-d) as 2010-11-24, need to convert it to
1) 24 Nov, 2010
2) 24_Nov_2010
Help appreciated, thanks.
- (d M, Y)
- (d_M_Y)
So, something like
date("d M, Y");
Will output todays date:
24 Nov, 2010
Edit: I may have read your question incorrectly. Can you please clarify if this is what you want? Or you wanted to convert the 24-11-2010 into the above formats?
If the latter if what you were seeking, you can simply utilise the strtotime function:
date("d M, Y", strtotime("2010-11-24"));
Most simple, you can use strtotime() to convert 2010-11-24 into date, and use date() to get seperate pieces(Y,m,D) and convert them to whatever format you want.
Please refer this link: http://php.net/manual/en/function.strtotime.php http://php.net/manual/en/function.date.php