I have datetime-local html control on my form and I need to set date and time on it dynamically via JS or jQuery. How can I do it?
Here is a simpler way to do it.
const now = (new Date().toLocaleString("sv-SE") + '').replace(' ','T'); console.log(now);