I am saving in my Database the date of the record in a field called Date , which input
is of type date
. It turns out that the data is being saved in the following way 2017-11-28
, that is the least of it, the problem arises in that I must and want to show that data on my website in the following way:
Desired result:
Viernes, 24 / Noviembre / 2017
The question is, how can I convert that date to the format I need?
My code:
//Fecha
$fecha = '2017-11-25';
//Imprimo.
echo $fecha;
Greetings.
strftime
— Formats a local date/time according to a local setting.setlocale
— Establish localism information.A possible example:
Result :
Sábado, 25 de Noviembre de 2017
.used formats :
%A
A complete textual representation of the day Sunday through Saturday%d
The two-digit day of the month (with leading zeros) 01 to 31%B
Full month name, based on localism January through December%Y
Four-digit representation of the year Example: 2038