Question

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));
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top