# How to calculate any date from current day, day in week, month and year?

I am implementing Calendar View for my iOS application. I am using Date structure for calculating date. But, manually I am stuck with following things. I need formulae for calculation between days depends upon current date.

For Example:

Need to find following categorise depends upon the current date.

Where current date,

let date = 07

let month = 11

let weekDay = 03 (Tuesday)

let year = 2017

Find:

1. Week day of this month where date is 01.
2. Week day of last month end date and start date.
3. Week day of current date on 2018.

Please give me the answer if you know at least one of 3 questions.

• Have you looked at the older questions listed under "Related"? Some of them look very relevant. – Gerry Myerson Nov 7 '17 at 11:50
• @GerryMyerson , Yes bro... tried 3 hours, but stuck with these 3 parts. – Rajamohan S Nov 7 '17 at 11:54
• Really? and you can't figure out what day of the week the 1st is, from knowing the 7th is a Tuesday? – Gerry Myerson Nov 7 '17 at 11:57
• @GerryMyerson, lol.. figured out just now bro... Thanks for this above comment.... may I need to delete this question? or Will I answer later? – Rajamohan S Nov 7 '17 at 12:01
• If you don't think it's answered at one of those related questions, you can post an answer. – Gerry Myerson Nov 7 '17 at 12:03