Ad

Laravel Blade Date Time Format

- 1 answer

I have a field in my cms to store dates. In my form.blade I did this:

<div class="col-sm-7 col-md-7 col-lg-5">
    {{ Form::date('date', new \DateTime(), ['class' => 'form-control']) }}
      {{-- {!! Form::text('date', null, ['class' => 'form-control']) !!} --}}
  </div>

and it look's like this enter image description here

How can i make it so it also have a time and not only date?

Ad

Answer

Try this:

{{ Form::datetimelocal('date', new \DateTime(), ['class' => 'form-control']) }}

But check whether it is properly submitting to the backend.

Ad
source: stackoverflow.com
Ad