• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mid-date of two dates  RSS feed

 
Pradeep Chandrasekharan Nair
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one please get me the code for getting the mid-date of two date. we should pass two arguments. one is start date and other end date.
Thanks in Advance
 
Eric McIntyre
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remeber that a Date is just a fancy wrapper around a long value (milliseconds since the epoch), and that value can be fetched with the getTime() method. The rest is left as an exercise for the reader

Eric
 
Pradeep Chandrasekharan Nair
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank Youuuuuuuuuuuu
I got it
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!