Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date again...

 
Kriss Masters
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have a problem If i would like to compare two dates and see how many days there are between them, how do i do that? and the result should be an "int".
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the articles Calculating Java dates and Working in Java time : Learn the basics of calculating elapsed time in Java - they have always been a good reference for me.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to take a look at Thomas Paul's TimeSpan class.
 
Kriss Masters
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark and Dirk!! Javaworld was a real goldmine
[ December 31, 2003: Message edited by: Kriss Masters ]
[ December 31, 2003: Message edited by: Kriss Masters ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic