从日期获取 PHP 中的月份名称
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37521837/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 01:15:45 来源:igfitidea点击:
Get month name in PHP from date
提问by perkes456
I have a date in my php function like following:
我的 php 函数中有一个日期,如下所示:
2016-05-17 16:41:51
Is there some way for me to get the month name from this date in PHP ?
有什么方法可以让我在 PHP 中从这个日期获取月份名称吗?
回答by Murad Hasan
Using the F
in the date parameter you can get the month name.
使用F
日期参数中的 可以获得月份名称。
echo date("F", strtotime('2016-05-17 16:41:51')); //May