Javascript function
How to write a javascript function to display current date and time?
Know the answer? Post it. Somebody with the same question will find it here.

Using new Date(), creates a new date object with the current date and time:
"demo"
>
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit KumarRank #459 · 5.4K reputationPosted Oct 16, 2020, 10:07 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Oct 15, 2020, 11:22 PM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Oct 18, 2020, 8:25 PM EDT
Farhan AhmedRank #73 · 25K reputationPosted Oct 18, 2020, 10:37 PM EDT