0

I need to display current date plus current time +1 hour in PHP laravel textbox my code as follows

    <input  name="SuggestedDate" class="form-control" id="inputSubject" placeholder="SuggestedDate" type="datetime-local" id="payment_due_at" value="">
Alex
  • 7
  • 7
  • 1
    Something like `value="{{ Carbon\Carbon::now()->addHours(1)->toDateTimeString(); }}"` – STA Aug 22 '20 at 15:30
  • @sta am new to laravel and PHP can you help me to write the code – Alex Aug 22 '20 at 15:32
  • just replace your `value=""` with the following code – STA Aug 22 '20 at 15:34
  • @sta am getting this error syntax error, unexpected ';', expecting ',' or ')' – Alex Aug 22 '20 at 15:35
  • 1
    Opps, try again with `value="{{ Carbon\Carbon::now()->addHours(1)->toDateTimeString() }}"` – STA Aug 22 '20 at 15:36
  • @sta noting is coming – Alex Aug 22 '20 at 15:38
  • @sta i put like dis – Alex Aug 22 '20 at 15:39
  • @sat now its working but the problem is if change the type my picker is not working – Alex Aug 22 '20 at 15:42
  • I dont know which date time picker you are using, but may be your date time picker accept date as [tag:javascript] instead of input value. Post another question with your input field and the js code together – STA Aug 22 '20 at 15:46
  • @sat actually i need if one customer enters a form there is one date field .in the date field by default need to show current date+plustime+extra one hr. and the customer can also change the date and time using the picker – Alex Aug 22 '20 at 15:48

0 Answers0