【发布时间】:2018-11-05 10:27:09
【问题描述】:
因为 laravel 使用 now() 作为 Carbon 类的辅助函数,所以我尝试了这个
dd(now('GMT+5:45')->isoFormat('x')))
但它返回 laravel 的错误方法调用异常,说明
Illuminate\Support\Carbon::isoFormat does not exist.
我想要的只是将日期和时间转换为time string,就像strtotime() 函数一样
我现在该怎么办?
【问题讨论】:
-
只在 carbon 实例上使用 format 函数
标签: php laravel datetime datetime-format php-carbon