Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No.of SUNDAY's between two dates???

 
Swapna Agarwal
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could any one tell me a simple logic to get No.of DAY's between 2 dates?
Example:
Start date:22/03/04
EndDate: 22/03/03
I want to get No. of SUNDAY's between these two dates.
Could any one tell me simple logic?
Thanks
--swapna
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swapna,
Take a look at the Calendar class. It can give you the day of the week for each of your two dates. From there, you can calculate the number of sundays.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a Servlet question, I'll move it to Java in General (beginnner) for you.
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic