php - How to set day of the week in Bulgarian language
177
I have to show tomorrow's day of the week in Bulgarian.
It is shown in English, how do I set it in Bulgarian?
<?php
$now= new DateTime('now');
$date=$now->modify('+1 day');
echo $date->format('l');
//prints Saturday
I did this with an array of Bulgarian names of days and it works, but is there a way to do it withsetlocale
or something else?
Answer
Solution:
Datetime
format
doesnt support locales, you have to convert to timestamp to usestrftime
Use LC_TIME in
setlocale
only to change the settings for time related formats