File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Calendar math Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Calendar math" Watch "Calendar math" New topic

Calendar math

Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126

I was wondering if it's possible to subtract one date from another, to determine how many days have passed?

For example:
- Say I have an record of a user account created on February 22, 2006.
- Today is March 14, 2006.

How can I determine how many days old the account is?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
Here are a couple of threads that discuss the topic.
I agree. Here's the link:
subject: Calendar math
It's not a secret anymore!