IT Community - Software Programming, Web Development and Technical Support

Calculate how many hours per each month

This is a discussion on Calculate how many hours per each month within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone tell me how can i calculate how many hours per each month. Thanks......


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-25-2008, 09:14 PM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 547
itbarota is on a distinguished road
Default Calculate how many hours per each month

Hi all...


Can anyone tell me how can i calculate how many hours per each month.


Thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-25-2008, 09:23 PM
Pvinothkumar Pvinothkumar is offline
D-Web Analyst
 
Join Date: Sep 2007
Posts: 237
Pvinothkumar is on a distinguished road
Default Re: Calculate how many hours per each month

Hi all...


<SCRIPT LANGUAGE="JavaScript"><!--
function makeArray() {
this[0] = makeArray.arguments.length;
for (i = 0; i<makeArray.arguments.length; i++)
this[i+1] = makeArray.arguments[i];
}

var months = new makeArray('Jan','Feb','Mar','Apr','May','Jun','Jul ','Aug','Sep','Oct','Nov','Dec');
var days_per_month = new makeArray(31,28,31,30,31,30,31,31,30,31,30,31);

function LeapYear(year) {
if ((year/4) != Math.floor(year/4)) return false;
if ((year/100) != Math.floor(year/100)) return true;
if ((year/400) != Math.floor(year/400)) return false;
return true;
}

function y2k(number) { return (number < 1000) ? number + 1900 : number; }

var myDate = new Date(1999,0,1); // 1st January 1999


if (LeapYear(y2k(myDate.getYear())))
days_per_month[2] = 29;
else
days_per_month[2] = 28;

for (var month = 1; month<12+1; month++) {
document.write(months[month] + ' ' + (days_per_month[month]*24) + ' hours<BR>');
}
//--></SCRIPT>


Thanks...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/html-css-javascript-coding-techniques/5338-calculate-how-many-hours-per-each-month.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 02-25-2008 11:24 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of days in a month (or last day of a month) itbarota HTML, CSS and Javascript Coding Techniques 2 04-28-2008 08:47 PM
Find the last day of the month for any given month. itbarota HTML, CSS and Javascript Coding Techniques 1 03-17-2008 08:56 PM
calculate the number of days in the current month itbarota HTML, CSS and Javascript Coding Techniques 1 02-08-2008 06:30 AM
How do i subtract a hours from a date? itbarota HTML, CSS and Javascript Coding Techniques 1 12-20-2007 06:19 AM
How many hours do you spend online? googoo The Lounge 18 03-23-2007 10:44 PM


All times are GMT -7. The time now is 10:02 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0