Ask coding questions
How do I add the current time of the user in html,css,js.
I found it.
Use Date.now() in JS.
EDIT: Combine with Date.getTimezoneOffset() to get time in local timezone.
@SixBeeps I am not that good with js, so can you give me an example or can you give the code
@sn236 My bad, it looks like Date.now() doesn't return a date like I remembered. Instead, construct a new Date object to get the current date in local time.
@SixBeeps It works, but not as I expected. I want the time to be displayed on the output screen.