0
创造我想要一些日期碳从时间戳
<p>{{ Carbon\Carbon::parse($post->created_at)->diffForHumans() }}</p>
也能正常工作的日期的格式为2017年5月1日10时52分51秒
不过,我也转换将日期存储为unix时间戳。
我该如何将这些转化为约会呢?
我已经尝试过
{{ Carbon\Carbon::createFromTimestamp($post->created_at)->toDateTimeString() }}
错误 - 非合式数值遇到
转储是
<pre class="xdebug-var-dump" dir="ltr">
<small>int</small>
<font color="#4e9a06">1493637826</font>
</pre>
http://carbon.nesbot.com/docs - 在你的浏览器搜索窗口输入“timestamp” –
这就是我已经尝试Carbon \ Carbon :: createFromTimestamp($ post-> created_at) - > toDateTimeString()} } – LeBlaireau
没有喜悦吗? –