marjorjie
Posts: 6
Nickname: jorj
Registered: Sep, 2005
|
|
kindly help me to explain this...please
|
Posted: Oct 4, 2005 5:52 PM
|
|
Advertisement
|
hi! i need to make a program that is about dates..
what is lacking is that i dont know how to get the days of the day...
i.e. Wedsday...and so on..
as i browse to the net, i found this format:
yearAsString=Integer.toString(tempYear); century=Integer.parseInt(year AsString.substring(2,4));
dayPosition = ((26*tempMonth-2)/10+day+yearInCentury +yearInCentury/4+century/4-2*century)%7;
why does tempMonth is multiplied by 26 and subtracted by 2? then divided by 10...and so on...
ive already tried this one...and it really works...
but the problem is, i can't explain on how this stuff works..
Or if ever you too can't explain this, do you have any suggestions on how to get the DayOfTheWeek without using the BUILT IN java class...
thanks to all!!!
|
|