Pawel Pawlowicz wrote:What are the requirements?
What have you tried?
What is "Excel Date"?
What converting Date to int has to do with "While, For, & Do Loop"??
NotACodeMill <- click this
StopCoding <- and this
Offtop
AAAAAAAAAAAAAAAAAA!!! Hungarian notation!!! NOOOOOOOOOOOOOO!!!
End of offtop
And welcome to the Ranch.
Microsoft Excel® numbers dates as 1, 2, 3, etc, beginning with January 1st, 1900. E.g., February 6th, 1900 is Excel Date 37. Have the user enter a date (month, day, and year) and call the iExcel method to get the Excel Date for the input date. Print it in your main method, not in iExcel.
Pawel Pawlowicz wrote:Did you try to google it?
http://stackoverflow.com/questions/7103064/java-calculate-the-number-of-days-between-two-dates
Jean Pe wrote:It's not so much calculating the dates in-between other dates.
...
lets say I have a list in Excel and my #1 is the date 1/1/1990
...
#2 1/2/1990
#3 1/3/1990
#4 1/3/1990
.....
#31 1/31/1990
#32 2/1/1990
.....
and lets say the list will continue for infinity.
Steve
Steve Luke wrote:
Jean Pe wrote:It's not so much calculating the dates in-between other dates.
...
lets say I have a list in Excel and my #1 is the date 1/1/1990
...
#2 1/2/1990
#3 1/3/1990
#4 1/3/1990
.....
#31 1/31/1990
#32 2/1/1990
.....
Given that 1/1/1990 is #1, why is 1/2/1990 #2? Why is 1/3/1990 #3? If someone gave you 1/12/1990 then what would you give them as a result? How did you come by that result? Do you see why Pawel gave the suggested topic he did and how it applies to your post?
and lets say the list will continue for infinity.
Then int is not the data type you need to use, since int will not take you to infinity (it will take you a long way, though).
Jean Pe wrote:And I didnt mean infinity sorry I meant the int limit : 32,767 Sorry for that.
Pawel Pawlowicz wrote:
Jean Pe wrote:And I didnt mean infinity sorry I meant the int limit : 32,767 Sorry for that.
Actually, the int limit is 2,147,483,647.
The value 32,767 is the short limit.
A big offtop:
I don't get this notation: 1/31/1990
Like month/day/year.
Is it american one?
It is (sorry for that) really stupid :P.
Like if I was giving you the time and told you
hours, then seconds, then minutes.
Or a latitude like: 23° 21″ 26′ N
I just don't get it. Sorry
End of big offtop
Pawel Pawlowicz wrote:
I don't get this notation: 1/31/1990
Like month/day/year.
Is it american one?
Life is full of choices. Sometimes you make the good ones, and sometimes you have to kill all the witnesses.
Jan Hoppmann wrote:we use day/month/year, or year-month-day
stan johnson wrote:I'm not seeing a solution using a loop. set the starting date. set the parameter date. take the difference in days. return number of days as an int. What did i miss?
Ok right after i posted this i see how you can do it. Keep a counter and loop adding a day to the starting date, until you get to the parameter date. return the counter. There ya go.
There are three kinds of actuaries: those who can count, and those who can't.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |