• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calculate no of weekday in given date range

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Suppose i have a date range say
[2002-10-01 00:00:00] to [2002-10-31 23:59:59]
I would like to calaute howmany WEDNESDAY'S fall in this date range.
How do i do this?
Thanks
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For this u atleast need one referance point. So maybe take user input of the date and day (on which he is running the program) or else u can pick up the date and day from the Computer itself.Then using normal equations u can find out what day was on 01/10/2002 [for MBA preparation they deal with many such problems]. Now if 01/10 comes out to be a Sunday (eg.), for Wednesday u need to add 3 to it as 4/10/2002 will be the first wed and then keep on adding 7 to it till the time it reaches 31st.
Hope this helps
Rgds
 
reply
    Bookmark Topic Watch Topic
  • New Topic