SQL PHP HTML ASP JavaScript articles and free scripts to download

setMinutes()

We can set the minutes part of the date object by using setMinutes function. By using this we can set the minute from 0 to 59. Let us try to set the minutes to 20 of a date object. Here is the example

<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

Setting minutes to a negative value

What happens if we set the minutes value to -75? Here is the sample code , just change the line in above code to

dt.setMinutes(-75);

The output of this change is here.


Google+

More on JavaScript Date & Time
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked




Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer