I have a string as mentioned below:
$ts = '3/11/09 11:18:59 AM';
which I got using the date() function.
Now I need to convert this to a readable format like below
11-Mar-2009
I have tried everything using date(). How can I achieve this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to convert it to something you can use for further formatting. strtotime() is a good start, which yields a unix timestamp. You can format that one using strftime() then.