Is there a way to change a date from
1985-12-15
to
1985-12
without using a regular Expression?
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.
That should do it.
This will, using strtotime, convert 1985-12-15 to a unix timestamp. The date function then takes a second parameter timestamp on which to format the date.