A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
Java Calendar Dates
Anil Karamchandan
Ranch Hand
Joined: Sep 12, 2009
Posts: 47
posted
Feb 27, 2010 14:08:08
0
Hi all,
I am currently building a payroll software code and stuck at a point, I would do my best to explain and get any help
I have a pay period Start date and End Date this can be any period
When I enter the period as (in mm/dd/yyyy format)
Start date "04/08/2010"
End Date "05/08/2010"
then I add 1 month to a calendar handler.add(Calendar.Month,1)
the next and the corresponding dates are
Start date "05/08/2010"
End Date "06/08/2010"
Start date "06/08/2010"
End Date "07/08/2010"
corresponding as desired. But the moment I enter the start date and end date as
as
Start date "04/01/2010"
End Date "04/30/2010" which is a 1 Month period and then add 1 Month to the code
the corresponding dates are
Start date "05/01/2010"
End Date "05/30/2010"
Start date "06/01/2010"
End Date "06/30/2010" [ Even though it has 31 days in June, then from Feb 2011 its like
Start date 01/01/2011
End Date 01/30/2011
Start date 02/01/2011
End date 02/28/2011
Start date 03/01/2011
Start date 03/28/2011
everything ends on the 28th
Can any one let me know why in my first condition the 31st day was being taken care of and in the next condition I am not getting the same output.
Details 04/01/2011 04/28/2011
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56549
14
I like...
posted
Feb 27, 2010 14:14:54
0
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please
read this
for more information.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Java Calendar Dates
Similar Threads
Problem with carrying over the correct months while using GetDate()
dates between two dates
Multiple Sub-queries. efficient or not ?
Java Calendar Dates
Problem moving columns and rows in 2D array.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter