Store the given date and time into the given input element. Everything will be displayed in local time, similar to dateAndTime.toString().
Going the other way is easy: new Date(input.value).
new Date(input.value)
This should be set to "datetime-local".
The date and time to load into the input.
Store the given date and time into the given input element. Everything will be displayed in local time, similar to dateAndTime.toString().
Going the other way is easy:
new Date(input.value)
.