<html> <body> <button onclick="var myDate = new Date(); myDate.setTime(myDate.getTime()); alert(myDate);">Date: set Time</button> </body> </html>