将月份名称更改为法语 [英] change month name to french

查看:89
本文介绍了将月份名称更改为法语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有此代码:

<?php 
  echo "'".$sgps_newsletter->getEmail()."' demande en ".date('d.M.Y', strtotime($sgps_newsletter->getCreatedAt())) 
?> 

,但是月份名称用英文开头.我该怎么做才能用法语显示?我已将settings.yml默认文化更改为法语,但是什么也没发生.

but the month name is appering in english. What can I do to show it in french? I've change the settings.yml default culture to french, but nothing happens.

推荐答案

来自 http://php.net/manual/en/function.date.php :

要使用其他语言设置日期格式,您应该使用 setlocale() strftime()函数而不是date().

To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().

这篇关于将月份名称更改为法语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆