Total Hours Calculation.

Total Hours Calculation.

Hi,How to calculate the total hours by startime and endtime.not railway time just only normal time.please help.

Thanks.

View Answers

March 28, 2011 at 3:15 PM

Hi,

function calcHours(){
  var date1 = document.getElementById('d1').value;
  var date2 = document.getElementById('d2').value;
  date1 = date1.split("-");
  date2 = date2.split("-");
  var sDate = new Date(date1[0]+"/"+date1[1]+"/"+date1[2]);
  var eDate = new Date(date2[0]+"/"+date2[1]+"/"+date2[2]);
  var hourhsDifference = Math.abs(Math.round((sDate-eDate)/1000*60*60));
  alert("hourhsDifference :"+hourhsDifference );
}

Ads









Related Tutorials/Questions & Answers:
Total Hours Calculation.
Total Hours Calculation.   Hi,How to calculate the total hours by startime and endtime.not railway time just only normal time.please help. Thanks
calculation
calculation  helo all, can any one tell me ...how to add values taken from text box and display it to user. the requirement is..from total amount to be paid and total paid we have to find the due amount to be paid..and each
Advertisements
age calculation
age calculation  pls send me the age calculation validation coding in java script. i'm waiting for ur reply
tax calculation
tax calculation  I want you to write a program while take some amount and do the tax calculation Sr.No. Particulars Present Rate Amount in INR 1 Service Fee - 100 2 Service tax Tax 12.00% 12 Education cess
ModuleNotFoundError: No module named 'calculation'
ModuleNotFoundError: No module named 'calculation'  Hi, My Python... 'calculation' How to remove the ModuleNotFoundError: No module named 'calculation' error? Thanks   Hi, In your python environment
calculation after if. user input
calculation after if. user input  System.out.print ("please select... it should add up total. It doesn?t seem to do that without the ifs, if else it will. I...("Total Cost: "+totalcost
ModuleNotFoundError: No module named 'refund_calculation'
ModuleNotFoundError: No module named 'refund_calculation'  Hi, My... named 'refund_calculation' How to remove the ModuleNotFoundError: No module named 'refund_calculation' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'simplex_calculation'
ModuleNotFoundError: No module named 'simplex_calculation'  Hi, My... named 'simplex_calculation' How to remove the ModuleNotFoundError: No module named 'simplex_calculation' error? Thanks   Hi
ModuleNotFoundError: No module named 'Solar-Calculation'
ModuleNotFoundError: No module named 'Solar-Calculation'  Hi, My... named 'Solar-Calculation' How to remove the ModuleNotFoundError: No module named 'Solar-Calculation' error? Thanks   Hi, In your
How to calculate attending hours?
How to calculate attending hours?  I need to calculate attending hours of a employee in a day in my project to make their monthly salary . By using work starting time and ending time. How should I do it using Date class? Or any
ModuleNotFoundError: No module named 'total'
ModuleNotFoundError: No module named 'total'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'total' How to remove the ModuleNotFoundError: No module named 'total'
How to display a file for 24 hours?
How to display a file for 24 hours?  How to display a file for 24 hours
Calculation Example
Calculation Example      .... This code displays the product name and their price with the total amount...("./src/velocity/calculation/Product.vm");   
program to print total marks
program to print total marks  program to input total marks out of 600 marks as an argument and print the stream allotted using the following criteria 401 & above - PCM 301-400 - ZBC 201-300- Commerce 101-200 - Arts
ModuleNotFoundError: No module named 'opening_hours'
ModuleNotFoundError: No module named 'opening_hours'  Hi, My... 'opening_hours' How to remove the ModuleNotFoundError: No module named 'opening_hours' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'pyopening_hours'
ModuleNotFoundError: No module named 'pyopening_hours'  Hi, My... named 'pyopening_hours' How to remove the ModuleNotFoundError: No module named 'pyopening_hours' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'steelscript.appfwk.business-hours'
ModuleNotFoundError: No module named 'steelscript.appfwk.business-hours' ...: ModuleNotFoundError: No module named 'steelscript.appfwk.business-hours' How to remove the ModuleNotFoundError: No module named 'steelscript.appfwk.business-hours'
How to learn hibernate in 24 hours?
How to learn hibernate in 24 hours?  Hi, I am assigned a new project and after 2 days I have to start working on it. I have 48 hours with me. I will spend 24 hours from 48 hours. I want to learn Hibernate in just 24 hours
Total summay from a sale table
Total summay from a sale table  Total summay from a sale table
Java add hours to Date
Java add hours to Date In this tutorial, you will learn how to add hours... used in date time manipulation. Here, we are going to add few hours to current...() of Calendar class, we have added 4 hours to the calendar which in result display
ModuleNotFoundError: No module named 'total-ordering'
ModuleNotFoundError: No module named 'total-ordering'  Hi, My... named 'total-ordering' How to remove the ModuleNotFoundError: No module named 'total-ordering' error? Thanks   Hi, In your python
how many hours and minutes in 8725 seconds
how many hours and minutes in 8725 seconds  how many hours and minutes in 8725 seconds? Thanks
how to print of hours and minutes of 8725 seconds
how to print of hours and minutes of 8725 seconds  how to print of hours and minutes of 8725 seconds
cache refresh after 24 hours
cache refresh after 24 hours  I have developed an application which uses websphere application server 6.1 which needs to query the database(oracle) after every 24 hours periodically.But it is not getting executed properly because
ModuleNotFoundError: No module named 'osm-humanized-opening-hours'
ModuleNotFoundError: No module named 'osm-humanized-opening-hours'  ...: No module named 'osm-humanized-opening-hours' How to remove the ModuleNotFoundError: No module named 'osm-humanized-opening-hours' error? Thanks
ModuleNotFoundError: No module named 'osm_opening_hours'
ModuleNotFoundError: No module named 'osm_opening_hours'  Hi, My... named 'osm_opening_hours' How to remove the ModuleNotFoundError: No module named 'osm_opening_hours' error? Thanks   Hi, In your
how to done calculation for dynamic generated textboxes in jquery/javascript/ajax?
how to done calculation for dynamic generated textboxes in jquery/javascript/ajax?  how to done calculation for dynamic generated textboxes in jquery/javascript/ajax
Java program to generate the total count
Java program to generate the total count  I need a java program which would take a text file as an input and scans through it to generate the output. For Ex. : If the text file contains the following information: There is/are 3
ModuleNotFoundError: No module named 'odoo8-addon-product-template-book-weight-calculation'
-calculation'  Hi, My Python program is throwing following error...-weight-calculation' How to remove the ModuleNotFoundError: No module named 'odoo8-addon-product-template-book-weight-calculation' error? Thanks
ModuleNotFoundError: No module named 'location-history-total'
ModuleNotFoundError: No module named 'location-history-total'  Hi...: No module named 'location-history-total' How to remove the ModuleNotFoundError: No module named 'location-history-total' error? Thanks   Hi
ModuleNotFoundError: No module named 'mantid-total-scattering'
ModuleNotFoundError: No module named 'mantid-total-scattering'  Hi...: No module named 'mantid-total-scattering' How to remove the ModuleNotFoundError: No module named 'mantid-total-scattering' error? Thanks   

Ads