Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    21
    Thanks
    6
    Thanked 0 Times in 0 Posts

    var now = new Date(); help with this

    can someone explain to me what var now = new Date(); is actualy doing

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    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();

  • Users who have thanked Philip M for this post:

    haydar (05-07-2009)

  • #3
    New Coder
    Join Date
    May 2009
    Posts
    21
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •