hi, I was actually working on to calculate the number of days between two dates of dd/mm/yyyy format using javascript. can anyone suggest me how to work it outin calculating the difference between the two dates

View Answers

April 27, 2012 at 5:50 PM

<script> var oneDay = 24*60*60*1000; var firstDate = new Date(2012,04,24); var secondDate = new Date(2012,04,26); var days = Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay)); document.write("Number of days: "+days); </script>

Ads

Related Tutorials/Questions & Answers:

calculate difference between two dates hi, I was actually working on to calculate the number of days between two dates of dd/mm/yyyy format... the difference between the two dates

calculate difference between two time in jsp How to calculate difference between two dates

Advertisements

Hi .Difference between two Dates Hi Friend.... Thanks for ur Very good response.. Can u plz guide me the following Program.... difference between two dates.. I need to display the number of days by Each Month

Javascript calculate number of days between two dates In this tutorial, you will learn how to calculate number of days between two dates.For this, you need... using Date.getTime() function. Once both Dates have been converted, subtracting

mysql difference between two numbers How to get total bate difference between two dates for example 1/01/2012 and 1/02/2012 in MYSQL? ... between two date. The syntax of DATEDIFF is .. SELECT DATEDIFF('2012-01-31 23:59

on that. The thing is, that I need to find the difference between the two dates in JAVA... the difference between two dates. public class DateDiffDemo { public static...Difference in two dates Hello there once again........ Dear Sir

calculate difference of two times and express it in terms of hours i need jsp code to find out the difference of two times in format hh:mm:ss...(); } } } The above code parse two times and ouputs the difference between two times in terms

calculate difference of two times and express it in terms of hours i need jsp code to find out the difference of two times in format hh:mm:ss...(); } } } The above code parse two times and ouputs the difference between two times in terms

calculate difference of two times and express it in terms of hours i need jsp code to find out the difference of two times in format hh:mm:ss...(); } } } The above code parse two times and ouputs the difference between two times in terms

days between two given dates using PHP How can we know the number of days between two given dates using PHP? Hi friends, Example: <html> <head> <title>Number of days between two

calculate difference of two times and express it in terms of hours i need jsp code to find out the difference of two times in format hh:mm:ss and want to round off the result to a hour value.it's very urgent.plz someone help me

calculate difference of two times and express it in terms of hours i need jsp code to find out the difference of two times in format hh:mm:ss and want to round off the result to a hour value.it's very urgent.plz someone help me

list of all months between two dates in java Hi, I want to get list of all months with year between two dates. How to do this in Java? Thanks Hi, This is the example code which can be used: package test.app

list of all months between two dates in java Hi, I want to get list of all months with year between two dates. How to do this in Java? Thanks Hi, This is the example code which can be used: package test.app

JavaScript check if date is between two dates. Check if date is between two dates? <html> <head> <title>Date before...;/head> <body> <h2>Check if date is between two dates</h2>

How to select Data Between Two dates in Java, MySQL How to select Data Between Two dates in Java, MySQL? Thanks in advance. http://www.v7n.com/forums/coding-forum/294668-how-select-data-between-two-dates-php

Java Swing Date Difference In this tutorial, you will learn how to find the difference between two dates. Here is an example that accepts two dates from... the following method that calculates the date difference in terms of days

difference between any two dates. Understand with Example The Tutorial describe... the time difference between any two consecutive dates. TimeDiff('Year1 Time1', 'Year2 Time2') : The Query performs the time difference between any consecutive

mysql between dates not between dates I am trying to list the data between dates and not between dates using join method ..but that not working for me

Jdbc connectivity in java to oracle for retrieving data between two dates Dear Sir, I Need a program in which i want to retrieve the data b/w two dates from the database table. I am using combo box to get the date. Problem

How to calculate Date Difference in Java? Hi, I have two dates variable. How to calculate Date Difference in Java? Thanks Hi, You can use the Calendar class for calculating the date difference in Java. Get data

what is difference between one-way data binding and two-way data binding? what is difference between one-way data binding and two-way data binding? Thanks

Difference between struts and JSF What is the difference between struts and JSF

difference between == and === operators? Is (====) operator available in java or not? difference between

What is the difference between the >> and >>> operators? hi, What is the difference between the >> and >>> operators? Thanks

Date Difference This example learns how to make the difference between two dates and how... Object class and makes a difference between a Date object and a set of integer

the number of days between the two described dates. In order to get the number of days between two dates, the given example has set two dates by using... of days between two dates: return (int)( (d2.getTime

Difference between Timer and Thread? Can anyone tell me about the difference between Timer and Thread, Why we need to have Timer in case we have Thread implimentation startegy in Java

what is the difference between extends and implements difference between extends and implements

what is the difference between extends and implements difference between extends and implements