拉拉维尔碳日期格式为 2017-12-01T16:48:00



如何在 Laravel 2017 中以 2017-12-01T16:48:00 格式生成日期时间 5.8? 当我使用此代码时:

Carbon::now()

我有结果: 2019-08-24 15:07:27.629826 欧洲/华沙 (+02:00(

我需要明天的日期格式为2019-08-24T15:08:00

我该怎么做?

请阅读有关碳格式的信息。另外Carbon扩展了 phpDateTime请阅读 php 中的日期和时间格式。

至于你的问题:

echo Carbon::now()->format('Y-m-dTH:i:s'); // now
echo Carbon::tomorrow()->format('Y-m-dTH:i:s'); // tomorrow
echo Carbon::now()->addDays($n)->format('Y-m-dTH:i:s'); // n days ahead

相关内容

最新更新