4
Check out my database:
I’m using the following code:
<?php
$data = $noticia->data_cadastro;
setlocale(LC_ALL, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese");
date_default_timezone_set("America/Sao_Paulo");
echo strftime("%A, %d de %B de %Y", strtotime($data));
?>
Content of the variable: $data
: var_dump: "string '09/02/2015 15:55:30' (length=19)"
Returns in format: "Wednesday, 02 September 2015".
I would like you to return "Monday, February 9, 2015"; and then customize to "09 February 2015";as I do?
Differs from posting:"Format date in PHP" for where is echo strftime( '%A, %d de %B de %Y', strtotime('today'));
in my case has a variable $date
, simple, but it’s making a difference in my case.
You mean
09 de Fevereiro
?– Oeslei
@Oeslei, 9 February 2015, but should be displayed as "02 February 2015", layout...
– Adriano Aquino
Will never display "02 February 2015" if its date is "2015-02-09 (2015 February 09)"
– Luis Henrique
@Luishenrique, similar, changing "strtotime('Today'));" to "strtotime('$data'))" and did not work...
– Adriano Aquino
The field guy is marked as what?
– Wallace Maxters
Confusing question! :\
– Wallace Maxters
@Wallacemaxters, see if you’ve improved.
– Adriano Aquino