Pregunta

For some reason, it shows me incorrect minutes and hour, and month. It should show "October" and correct minutes and hour.

setlocale(LC_ALL, 'et');

$date = strtotime($row['date']);

echo date("d B Y H:i", mktime($date));
¿Fue útil?

Solución

You should use strftime() instead of date(). (date() is not locale aware.)

http://php.net/strftime

And the mktime() is not needed. strtotime() already sets $date as a timestamp.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top