How to set language for Carbon?

前端 未结 2 1863
甜味超标
甜味超标 2021-01-18 06:55

So i want to set language for Carbon, but i always get same result.

  Carbon::setLocale(\'es\');
$archive_current_year = Articles::whereBetween(\'created_at\         


        
2条回答
  •  日久生厌
    2021-01-18 07:43

    try using PHP function setlocale also check if your hosting allows and gives you the locales you want.

     setlocale(LC_TIME, 'es_ES');
     Carbon::setLocale('es');
     $archive_current_year = Articles::whereBetween('created_at', [
     ....
    

提交回复
热议问题