Creating datetime field with Laravel Collective

Asked

Viewed 1,321 times

3

I’m creating a field using the Laravel Collective however I am having problems with the field date, first I am not able to create the field DATATIME and another problem is that it is coming the formed of the bank, as I can do to solve these two problems ?

{!! Form::date('Visivel_Ini', \Carbon\Carbon::now(), ['class' => 'form-control']) !!}

1 answer

3


The method is datetime:

Form::datetime('visivel_Ini', \Carbon\Carbon::now(), ['class'=>'form-control'])

If you prefer the date in Brazilian format:

Form::input('text', 'visivel_Ini', \Carbon\Carbon::create()->format('d/m/Y H:i:s'), ['class'=>'form-control'])
  • When I put this Carbon::now() it returns me only the date, how to do to return tbem the time ?

  • 1

    @Renanrodrigues Carbon::now() will actually return a format like this: 2016-06-24 15:18:34 same as specified in doc api http://carbon.nesbot.com/docs/. You need exactly what?

  • I need to set today’s date and time in the field

  • 1

    I did the editing...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.