I've the date 10.5.2010 for example and want to know what's the name of the day (Monday, Tuesday, ...).
Now I need an algorithm which has the parameters int year
, int month
, int day
and calculates the name of the day which was at the 10.5.2010. BUT the algorithm also must be able to calculate days, which are in the future.
I hardcoded into my code, that the 10.9.2014 is a Wednesday, so I can calculate by using that. Also you must be careful with leap-years because you got one day more to count.
Can someone help me, just pseudo code if it's possible, I want to try to make the biggest part on my own. If there are a few lines of code it's okay, but please no full runnable code
I don't want to use any Java libraries to make this easier (e.g. no Calendar
).