Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Feedback on: irt.org FAQ Knowledge Base Q1773

irt.org | About | Feedback | 5013 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q1773

Sent by
bela on Tuesday September 11, 2007 at 16:26:07

Worth:
Worth reading

Length:

Technical:

Comments:
function calculateDate(date1, days) {//calculate a date base on vdate+days. Date format is YYYYMMDD
var old_date = new Date(date1.substring(0, 4), parseInt(date1.substring(4, 6) - 1), date1.substring(6, 8));

var one_day = 24*60*60*1000;

alert(old_date.getTime());

var new_date = new Date(old_date.getTime()+(24*60*60*1000)*days);

var new_m = new_date.getMonth() + 1;
if (new_m > 9) m= '' + new_m;
else m = '0' + new_m;

var new_d = new_date.getDate();
if (new_d > 9) d= '' + new_d;
else d = '0' + new_d;

alert(new_date.getFullYear() + m + d);
return new_date.getFullYear() + m + d;

}




Other feedback on 'irt.org FAQ Knowledge Base Q1773' - show all


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.