-1
I have the variable below and want to format to the Brazilian standard (20/01/2015) using PHP.
$data = Sun Jan 10 00:00:00 CST 2016
-1
I have the variable below and want to format to the Brazilian standard (20/01/2015) using PHP.
$data = Sun Jan 10 00:00:00 CST 2016
3
Convert that date by to timestamp with strtotime()
and then take the desired format with date()
echo date('d/m/Y', strtotime('Sun Jan 10 00:00:00 CST 2016'));
Browser other questions tagged php date
You are not signed in. Login or sign up in order to post.
Sun Jan 10 00:00:00 CST 2016
is the output of the variable. Then you need to see how it is declared. In this case I think you are using Datetime. To display for example today’s date in the format you want using date, is to simply do$data = date("d-m-Y");
– gustavox
It actually exits as an array: [x-Quiry-Arrival] => Sun Jan 10 00:00:00 CST 2016
– Diego Marquez
Put the variable declaration...
– gustavox
php is reading this variable as a text and not as a date, how do I turn it into a date, then I do the formatting.
– Diego Marquez
I think that this question can help you... On this other also.
– gustavox