我想从 DateTime::format('D, d.m.Y H:i')
得到德语输出,这意味着我想得到 '而不是 'Sun, ...'所以, ...'。我设置了 setlocale(LC_ALL,'de_DE');
但这并没有解决问题。
最佳答案
首先使用 setlocale() 设置语言环境功能。
setlocale( LC_ALL, 'de_DE' );
将时间戳转换为人类可读的日期。
$local_date = date( 'l, d.m.Y', '1537551000' ); // 1537551000 timestamp
根据区域设置使用 strftime() 格式化本地时间/日期功能。
$de_date = strftime( '%A, %d.%m.%Y', strtotime( $local_date ) );
关于php - 德语的 DateTime::format(星期几),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26961989/