如何以给定格式格式化日期
大家好,我需要完全像这样设置日期格式 Dienstag 28. September 2010, 15:00 Uhr
(德语单词),最好的方法是什么?谢谢。
我想我必须使用日期函数但如何编写格式
Hi all I need to format date exactly like this Dienstag 28. September 2010, 15:00 Uhr
(German words), what is the best way? Thanks.
I guess I have to use date function but how to compose format
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
date()
无法为您提供德语文本,您必须使用strftime()
示例:
date()
won´t be able to get you a German text, you will have to usestrftime()
Example:
setlocale
和strftime
setlocale
andstrftime
您可以使用 setlocale() 设置 PHP 语言,然后使用 strftime( ) 具有相应的格式。这将使您获得德国的输出。
You can set your language in PHP with setlocale() and then use strftime() with the corresponding format. That will allow you to get german output.