...

View Full Version : var now = new Date(); help with this



haydar
05-07-2009, 06:39 PM
can someone explain to me what var now = new Date(); is actualy doing

Philip M
05-07-2009, 07:01 PM
If you tried Google you would find many explanations. Such as
http://www.w3schools.com/jS/js_obj_date.asp

Or you could simply try it yourself:-

var now = new Date();
document.write(now);

This creates a new Date object named now.
Note: The Date object will automatically hold the current date and time as its initial value.

That object can be further interrogated. e.g:

var hours = now.getHours();
var minutes = now.getMinutes();

haydar
05-07-2009, 07:13 PM
If you tried Google you would find many explanations. Such as
http://www.w3schools.com/jS/js_obj_date.asp

Or you could simply try it yourself:-

var now = new Date();
document.write(now);

This creates a new Date object named now.
Note: The Date object will automatically hold the current date and time as its initial value.

That object can be further interrogated. e.g:

var hours = now.getHours();
var minutes = now.getMinutes();

love u lol

thanks alot helped alot



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum