•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,064 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,463 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1931 | Replies: 5
![]() |
var date1 = new Date(); var date2 = new Date(); var diff = new Date(); diff.setTime(Math.abs(date1.getTime() - date2.getTime())); return (diff.getTime() / (1000 * 60 * 60 * 24));
theres the basics given that date1, date2 are the dates you wish to compare
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
well those were the basics which you should be able to adapt upon. for my efforts ive posted it up for all to see.
http://www.daniweb.com/code/snippet794.html
http://www.daniweb.com/code/snippet794.html
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
You can get it within +/- two days (no matter the length of the interval) just by integer-dividing the the output of the above formula by 7, and then multiplying by 5.
To refine it more, you need to know what day of the week each day is, and add or subtract up to two days, according to which days of the week each day is.
If the start and end dates are the same day of the week, no adjustment is needed.
To refine it more, you need to know what day of the week each day is, and add or subtract up to two days, according to which days of the week each day is.
If the start and end dates are the same day of the week, no adjustment is needed.
Daylight-saving time uses more gasoline
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp cross-browser javascript menu with few lines of code developer development firefox home html internet javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator microsoft msdn office prevent javascript menu from getting hidden under flash movies site software sql vista web
- Previous Thread: Link on Image
- Next Thread: HELP needed on javascript menus PLEASE...



Linear Mode