Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Date?????

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I've a problem regarding calculating no. of months ,years and days between two dates(with high precision) and also number of dates that can occur with a difference of month.
e.g.
1)date1=14-01-1999
2)date2=30-04-2001
so i need exact number of years,months and days and also number of dates with a difference of a month from 14-01-1999 till
30-04-2001
Actully i had tried it by using getTime() method of Date class
but unable to get precise answer.
from
sp


 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can format the dates any way you like, have a look at the class java.text.SimpleDateFormat.
It looks like you want to perform arithmetic on your dates, so you should also look at java.util.GregorianCalendar which has some arithmetic methods.
However you might still have to write some methods of your own to do exactly what you want
[This message has been edited by greg philpott (edited January 30, 2001).]
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JDate and GDate classes the the com.javaranch.common package (available at http://www.javaranch.com/common.jsp ) has some really handy stuff to support date arithmetic.
[This message has been edited by Bill Compton (edited January 30, 2001).]
 
I am a man of mystery. Mostly because of this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic