Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Set Minutes method Js

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 136
    Comment on it

    We can set the minutes part of the date object by using setMinutes function Sets the minutes value in the Date object using local time. Set methods take optional arguments using the value returned from corresponding get methods, if you do not specify an optional argument. For example, if the numSeconds argument not specified, JavaScript uses the value returned from the getSeconds method.

    Syntax

    dateObj.setMinutes(numMinutes[, numSeconds[, numMilli]]) 
    
    dateObj
        Required. Any Date object.
    
    numMinutes
        Required. A numeric value equal to the minutes value. Must be supplied if either of the following arguments is used.
    
    numSeconds
        Optional. A numeric value equal to the seconds value. Must be supplied if the numMilli argument is used.
    
    numMilli
        Optional. A numeric value equal to the milliseconds value.
    
    
    <script type="text/javascript"> 
    var dt= new Date();
    document.write( dt + "<br><br>");
    dt.setMinutes(15);
    document.write( "<br><br>" + dt );
    </script>
    

    Here is the output based on your time zone and date and time of your computer

    Tue Nov 17 2015 11:56:04 GMT+0530 (India Standard Time)
    Tue Nov 17 2015 11:15:04 GMT+0530 (India Standard Time)
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: