【发布时间】:2017-03-07 12:49:54
【问题描述】:
我目前正在我的项目中做一个项目我想显示日期/月份/只有两位数的年份,但我不能这样做。日期在数据库中,其格式为 yyyy-mm-dd H-i-s 格式这是我的代码
<p class="text-lg">Meeting request sent to
<strong>{{ (!empty($provider_detail->first_name)) ? $provider_detail->first_name : '' }} {{ (!empty($provider_detail->last_name)) ? $provider_detail->last_name : '' }}</strong></br>
{{ (!empty($booking->booking_date)) ? date("y/m/d",$booking->booking_date) : '' }}
显示错误。
ErrorException in 32beed24f6cd306408a9dd85ca2812a4630c92ec.php line 20:
A non well formed numeric value encountered (View: /home/devtqdyp/public_html/syncopp/resources/views/frontends/booking-successful.blade.php)
请帮我解决这个问题。 谢谢
【问题讨论】:
-
请显示错误。
-
$booking->booking_date是否来自数据库?即它的yyyy-mm-dd格式? -
是的,它来自数据库。没有它的 dd-mm-yyyy 格式@RiggsFolly
-
更新了我的问题@Chris Cousins
-
不,先生。它给了我其他时间。我的时间是 16/10/25,但它给了我 69/12/31。 @RiggsFolly
标签: php mysql laravel date laravel-blade