Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions Total Hours Calculation.

Have Programming Question? Ask it here!
 
 
 


Murugesan
Total Hours Calculation.
1 Answer(s)      3 years and 4 months ago
Posted in : JavaScript Questions


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

Thanks.


Advertisement
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 );
}



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
calculate total hours by start time and end time in javascript - Ajax
calculate total hours by start time and end time in javascript  hi, i... well. i want to display total hours by using start and end timepicker. pls clarify my doubts. how to calculate total hours by using start and end time field
Advertisements
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
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
total id
total id  how to print and total my id number ..for example if my id is 0123456789 the output will look like this : 0123456789 0+1+2+3+4+5+6+7+8+9=45 help me plz
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
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
Calculation Example
Calculation Example      .... This code displays the product name and their price with the total amount...("./src/velocity/calculation/Product.vm");   
How to display a file for 24 hours?
How to display a file for 24 hours?  How to display a file for 24 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
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
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
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
Total summay from a sale table
Total summay from a sale table  Total summay from a sale table
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
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
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
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
how to convert time in milliseconds in to hours - Java Beginners
how to convert time in milliseconds in to hours  hello, can anyone tell me how i can convert the time in milliseconds into hours or to display it in seconds in java
how to convert time in milliseconds in to hours - Java Beginners
how to convert time in milliseconds in to hours  hello, can anyone tell me how i can convert the time in milliseconds into hours or to display it in seconds in java
Find total disk space in PHP, php disk_total_space, disk_total_space
Learn How to Get the total disk space in PHP Program. In this PHP Tutorial example we will use the disk_total_space() function in our PHP code to find the total disk space. syntax disk_total_space() Function PHP disk_total_space
calculate difference of two times and express it in terms of hours
); out.println(diffInHours+"<br>"); out.println("Hours " + (int... of hours
calculate difference of two times and express it in terms of hours
); out.println(diffInHours+"<br>"); out.println("Hours " + (int... of hours
calculate difference of two times and express it in terms of hours
); out.println(diffInHours+"<br>"); out.println("Hours " + (int... of hours
calculate difference of two times and express it in terms of hours
); out.println(diffInHours+"<br>"); out.println("Hours " + (int
calculate difference of two times and express it in terms of hours
); out.println(diffInHours+"<br>"); out.println("Hours " + (int
java total lost data in hard drive
java total lost data in hard drive  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
java total lost data in hard drive
java total lost data in hard drive  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
java total lost data in hard drive
java total lost data in hard drive  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
Write a query to find the total number of rows in a table
Write a query to find the total number of rows in a table  Write a query to find the total number of rows in a table?   Hi, Here is the answer, we can find the total number of rows in a table using following query
JAVA TOTAL LOST DATA IN HARD DRIVE
JAVA TOTAL LOST DATA IN HARD DRIVE  please help me, i need java source code about total lost data in hard drive. how to find the total deleted data ih hard drive using java programming... this my project...pls help me
Java file get total space
Java file get total space In this section, you will learn how to get the total...("C:"); long totalSpace = file.getTotalSpace(); System.out.println("Total Space = " + totalSpace + " bytes"); } } You can find the total space
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.
Modify the sales tax program to accept an arbitrary number of prices, total them, calculate the sales tax and print the total amount.  Modify the sales tax program to accept an arbitrary number of prices, total them, calculate
Java Applet - Adding a Button to Decrease a Total
); } public void paint(Graphics g) { g.drawString("Total: " + gettestone..., it will display a button in a frame, that when clicked on will increase a total. Basically it will count the total number of times you click the button. What I need
Display total disk drive capacity
Description: This example will demonstrate how to get the total disk space... This method gets the total disk capacity in the bytes. Code... of this example depends upon number of drive you have and the total disk capacity
MySQL Addition
MySQL Addition       MySQL Addition returns you the sum value of the total counts in a table. The Aggregate function is used to perform the calculation in SQL Query. We make use
How to write a program count total prices
How to write a program count total prices  Hi. all I've got a assignment to write a program that count total prices of 8 costumers. class PriceCalculator{ public void method(double quantity) { double result
How to write a program count total prices
How to write a program count total prices  Hi. all I've got a assignment to write a program that count total prices of 8 costumers. First class... stuck in count total prices of 8 costumers like in this picture ![alt text][1
Tutorial for total beginner in Java
Tutorial for total beginner in Java - Explains the Basics of Java programming language. This is a video tutorial for total beginner in Java. In this video... language. This video is for total beginner in Java which will teach how to create
Learn Java in 24 hours
language within 24 hours as Java is based on C and C++ language. Most... find it easy to understand the example. To learn Java in 24 hours, you must clear
Calculate total number of elements remaining in the buffer.
Calculate total number of elements remaining in the buffer. In this tutorial, we will discuss how to calculate total number of elements remaining in the buffer.  IntBuffer API: The java.nio.IntBuffer class extends
Total Quality Management
for your lapses. Total Quality Management (TQM) is a part of business management
What will be the total cost for Golden Triangle Package tour from Delhi
What will be the total cost for Golden Triangle Package tour from Delhi   Hi, Can anyone give me the idea about Golden Triangle Package tour cost from New Delhi? I want's to travel by car. Thanks
program to enter values from one jsp page and then do calculation on some formula and that results is displayed in another jsp
program to enter values from one jsp page and then do calculation on some formula and that results is displayed in another jsp  <%@ page language="java" import="java.util.*;"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
How many hours a day/a week do you work?
How many hours a day/a week do you work?  ... to too many hours, you will feel guilty for not being able to keep up. If you... hours to the work whenever necessary. It has not been able to keep track of how many
total time calculator (starttime+endtime) in servlet USING DATABASE IN SQL2000 PLZ ANY ONE HELPME
total time calculator (starttime+endtime) in servlet USING DATABASE IN SQL2000 PLZ ANY ONE HELPME   <%-- Document : insertdate Created on : Jul 19, 2013, 3:48:28 PM Author : CG0T4908 --%> <
 

 

 

DMCA.com