Thursday, November 28, 2013

How to get the number of weeks in a month?




Recently I were in a need to findout and print the number of weeks in a given month. For sometime I was totally confused how can i do this.
I belive in approach called discuss and find solution of your problem. I applied the same approach, I called some of my juniors and told them the problem "How to find number of weeks in a given months and print the week start date and week end date?"
They all started working on the problem but none of them could come up with a solution, finally I told them, let me share you something with regards to this problem. I told them something and discussed with them. I left for the lunch, when I was coming back to office, immediately whatever I discussed with my collegues i tried implementing it.
The idea was successfull and I implemented the solution and called my collegues, see this is the solution.
I am just providing you the code, it might be useful for certain functionality life timesheet etc.

No comments:

Post a Comment