php - 更改月份名称php gantti类
问题描述
对于一个项目,我使用来自以下网址的 php gantti 类:https ://github.com/bastianallgeier/gantti 这非常有效。然而,没有成功的是将英文月份名称转换为荷兰名称。所以应该是梅而不是梅。我找不到确定月份名称的设置。我试过这个: date_default_timezone_set ('Europe / Amsterdam'); setlocale (LC_ALL, 'nl_NL'); 但是,这不起作用。可以调整月份名称吗?
亲切的问候,罗格
解决方案
您可以使用IntlDateFormatter将日期格式化为格式和时区:
$fmt = new IntlDateFormatter(
'de_DE',
IntlDateFormatter::LONG,
IntlDateFormatter::LONG,
"Europe/Amsterdam"
);
$fmt->setPattern('MMMM'); // set format of output.
echo $fmt->format( strtotime("20.05.2018") ); // here you set date, you can use time() instead
// I put 20.05 to test 'Mai' month.
// Mai
推荐阅读
- azure - 更改 microsoft azure 身份颁发者
- function - 关于按月和地区分组的总平均值的问题-谷歌表
- td-engine - 有没有办法删除TDengine数据库中某个vnode下的数据?
- python - 如何在电脑上查看kivy应用程序日志
- python - 发生错误时如何防止python exe关闭
- bitbake - Bitbake 如何处理食谱中的“inc”文件
- typescript - 二维数组 + 解构 = 类型错误
- c++ - 如何删除 std::vector 中选定的随机数据?
- javascript - 如何将已输入的表单数据添加到表格行?
- firebase - 将 Cloud Functions 中的快速端点重写为 Firebase 托管