我尝试使用3种不同的样式进行绑定,但它们都没有按预期工作:
示例日期时间:2018-03-02 23:00:00
//using h:i:s A ---> Nothing shown
{!! Form::time('field_name', \Carbon\Carbon::parse($user->relation->col_name)->format('h:i:s A'), ['class'=>'form-control']) !!}
//using h:i A ----> Nothing shown
{!! Form::time('field_name', \Carbon\Carbon::parse($user->relation->col_name)->format('h:i A'), ['class'=>'form-control']) !!}
//using h:i:s ----> Shows time but AM/PM does not work
{!! Form::time('field_name', \Carbon\Carbon::parse($user->relation->col_name)->format('h:i:s'), ['class'=>'form-control']) !!}
//using strtotime -----> same results like above
{!! Form::time('field_name', date('h:i:s A', strtotime($user->relation->col_name)), ['class'=>'form-control']) !!}
关于如何绑定23:00:00到AM PM哪个有用的任何想法?
第一种方法给出如下内容: