Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Setting minutes to a negative value

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 146
    Comment on it

    What happens if we set the minutes value to -80?

    Here is the example for setting a minutes in negative.

    1. var dt= new Date();
    2. document.write( dt + "<br><br>");
    3. dt.setMinutes(-80);
    4. document.write( "<br><br>" + dt );

    In dt.setMinutes(-80); it has a negative value.

    Gives the outuput (Wed Nov 18 2015 10:40:14 GMT+0530) for negative value:-

    1. Wed Nov 18 2015 12:26:14 GMT+0530 (India Standard Time)
    2.  
    3. Wed Nov 18 2015 10:40:14 GMT+0530 (India Standard Time)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: