Solved

Simple quest about Date objects

Posted on 2004-04-02
2
232 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 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