Web development Techniques
Tuesday, 26 June 2012
Substract date in js
var now = new Date();
//It will give the current date and time in default format.
var future = new Date(now .setHours(now .getHours()+24));
//in this we add 24 hours in present time .
var
diff
= Math.abs(future - now);
diff
in milliseconds.
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment