Solved

Simple quest about Date objects

Posted on 2004-04-02
2
271 Views
Last Modified: 2010-03-31
I have two instances of the java.util.Date object.  Each were created at a different time. How can I calculate the time that has elapsed between the two?
0
Comment
Question by:mwalker
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 10743192
Subtract them

long millisecDiff = d1.getTime() - d2.getTime();
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10743480
8-)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now