Get and set world date methods:
Get and set world time methods:
Other three important methods are toUTCString(), toLocaleTime(), and getTimezoneOffset() methods. The first two methods display the current date and time based on UTC and Local time and latter gets the difference in minutes between the UTC time and the Local time.
var curdate = new Date();
document.write("UTC time:"+curdate .toUTCString() +"<br>");
document.write("Local time:"+curdate .toLocaleString()+"<br>");
document.write("Difference:"+curdate .getTimezoneOffset()+" minutes") ;
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: