Knowledge Walls
Laya
Hyderabad, Andhra Pradesh, India
Date.prototype.setSeconds() Method in Date Class of Javascript Syntax with Examples
2099 Views
Usage 
The setSeconds() Method is used to set the seconds for mentioned date based on local time.
Syntax 
dateObj.setSeconds(secondsValue)
Example
var today = new Date();
document.write("Today: "+today);
document.write("<br />");

today.setSeconds(today.getSeconds() - 1);
document.write("1 Sec Before: "+today);
Output 
Today: Sat Nov 29 2014 13:06:01 GMT+0530 (India Standard Time)
1 Sec Before: Sat Nov 29 2014 13:06:00 GMT+0530 (India Standard Time)
Best Lessons of "Javascript Syntax with Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details