davej Posted March 31, 2012 Share Posted March 31, 2012 <script type="text/javascript">var d = new Date();var t = d.getTime();alert(t);t = d.getTime();alert(t);t = d.getTime();alert(t);</script> So apparently getTime retrieves a constant value that is created when the Date object is instantiated, or is there some trick to this? http://www.w3schools.com/jsref/jsref_gettime.asp Link to comment Share on other sites More sharing options...
Ingolme Posted March 31, 2012 Share Posted March 31, 2012 The date doesn't automatically update itself. The default value of a Date object is the moment it was created. Then you can set the hours, days, and other values later. Create a new date object each time you want the time updated. Link to comment Share on other sites More sharing options...
thescientist Posted March 31, 2012 Share Posted March 31, 2012 edit: as Ingolme said Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.