setlocale(LC_TIME, "ru_RU.CP1251"); $date = strftime("%d %B, %H:%M",strtotime($row['date'])); 

For some reason, if you use the code above, then everything seems ok, the date displays, but the month is still displayed in English: 26 May, 21:24 . If used:

 setlocale(LC_TIME, "ru_RU"); $date = strftime("%d %B, %H:%M",strtotime($row['date'])); 

That date is clumsy: 26 јРЩ, 21:24

How to fix?

  • four
    Use UTF-8, pozhzhzhaluysta! )) - kemerov4anin

1 answer 1

Better use a ready-made library or your own class for this, which will not depend on the locale and server settings. For example, here is my solution, which I use on all projects TimeHelper.php