What seems to be the problem:
I have a form where the user selects a date using the default html datetime-local widget.
When the user submits the form I take the time they selected and save it to my model and I also save another field using the now() function. But in my database the show different times. Both fields are datetimes.
They should have a few seconds difference because the user can select a time a few seconds/minutes earlier but not 7 hours, how can I make them the same “timezone”?
Steps to Reproduce:
Here’s my livewire component method:
Papercheck::create([
'ruta_ib' => $this->ruta_ib,
'caja' => $this->caja,
'hora' => $this->hora,
'realizo' => $this->realizo,
'hojas' => $this->hojas,
'registro_timestamp' => now()
]);
And here’s my input form:
<input id="hora" wire:model.lazy="hora" type="datetime-local" placeholder="Hora...">
Are you using the latest version of Livewire:
Yes, Laravel 7
Do you have any screenshots or code examples: