I want to transform a date from this format: 01/07/09 to this jan 07,09.
How can I do that in PHP?
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.
Use
strptimeto parse the value you’ve got, thendateto output it in the format you want:If you’re on Windows, or using a version of PHP where
strptimeis not available (< PHP 5.1.0), then usestrtotimeinstead, but be careful to make sure your date is in a US English format (i.e. “01/07/09” means January 7th 2009, not 1st July 2009).Also, if you really want
jan, rather thanJan, then usestrtolower: