如何格式化碳日期以获得完整的月份 [英] How to Format a Carbon Date to get the Full Month

查看:48
本文介绍了如何格式化碳日期以获得完整的月份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码:

 Carbon\Carbon::parse($quotation[0]->created_at)->format('d M Y')

输出为:

2016 年 3 月 10 日

10 Mar 2016

我想要:

2016 年 3 月 10 日

10 March 2016

我查看了 Carbon 文档并在 Google 上下搜索,但在任何地方都找不到.

I have looked at the Carbon docs and googled high and low, and I can not find it anywhere.

推荐答案

如果我理解正确:

 Carbon\Carbon::parse($quotation[0]->created_at)->format('d F Y')

顺便说一句,我在php date docs中找到了它,Carbon使用它来生成日期.https://www.php.net/manual/function.date

By the way, I found it in php date docs, Carbon uses it to generate date. https://www.php.net/manual/function.date

这篇关于如何格式化碳日期以获得完整的月份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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