php - can't get date in german language

前端 未结 4 1940
再見小時候
再見小時候 2021-01-18 07:19

I try to display a date in German but it doesn\'t work. I\'m using PHP with XAMPP.

These are my approaches:

function get_Datetime_Now() {
setlocale (         


        
4条回答
  •  心在旅途
    2021-01-18 07:50

    You are probably using a windows machine which has different language codes in PHP than a Unix based one.

    Try:

    setlocale(LC_TIME, 'de_DE', 'deu_deu');
    

    This will first try to set it to 'de_DE' (Linux/Unix) and have the 'deu_deu' code as a fallback for windows (PHP Version >= 4.3).

    Example in the german PHP documentation

提交回复
热议问题