• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

difference between 2 times

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

please tell me the APIs used to find the differences b/w 2 times.That is,

start time:- 10:12:35
end time :- 10:12:48

How to do it?

or

Please explain it with a code!
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mythily,
i am not sure if we be have direct way of fining time differnce. Well as for i know you have java.util.GregorianCalendar Class which helps to achive what you intend too...
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
depends on your requirements...

if we talk about short intervalls of minutes or hours or so, just get the difference of the millis and recalculate to seconds, minutes, whatever

if we talk about intervalls of days, months, years (leap years!) take joda-time. (just google it)

concerning code examples: the philosophy of this forum is more to help learning than to provide solutions. so, better show us what you did already, and then get help from many friendly users here... :-)

best regards,
jan
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic