How do I convert 20120204 to something like Mon, 04 Feb 2012 00:00:00 +0000?
Version of PHP is 5.4.
How do I convert 20120204 to something like Mon, 04 Feb 2012 00:00:00 +0000
Share
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.
$> php -r 'echo date("r", mktime(0,0,0,2,4,2012));'will give youSat, 04 Feb 2012 00:00:00 +0530…You can check detail syntax of date and mktime here
also before applying date you might also want to check this method:
$> php -r 'print_r(strptime("20120204", "%Y%m%d"));'which will give you components of input data format you have