What is the code for getting the current time?
A
now = new Date();
B
var now = new Date();
C
var now = Date();
D
var now = new Date(current);
Correct Answer: var now = new Date();
Date() is a predefined function in javascript which returns the date in string form. The above code determines the current time and stores it in the variable “now”.