Often, people refer to dates as the "second Friday in August, 2018" or the "fourth Sunday in March, 2012". But it's hard to tell what date that is! Your task to is to write a program that receives a year, a month, a day of the week, and an integer, and output that date.
For input, you will get a year, a month, a day of week, and a number.
You can take input in any reasonable format, like using a string for the day of week or using a zero indexed weekday, or even take the year and month in a single string. Do explain your input format in your answer, though.
The integer that tells you which day of week in the month to target will be an integer from 1-5. The integer will never refer to a day of week that does not exist(e.g. the fifth Friday of February 2019, which doesn't exist).
Years will always be positive.
Your output can be in any reasonable format, including printing your final date. However, please explain your output format un your answer.
Providing the year and month in the output is optional. Also, you may assume the date is valid.
Example Input and Output
Consider this input, with the format being taking in the year as a 4 digit number, month as an integer, day of week as string, and the ordinal number as an integer:
2019, 3, Saturday, 2
2019, 12, Sunday, 1
2019, 9 Saturday, 1
This is code-golf, so shortest answer wins.
date, but amusingly, the parser has an... interesting interpretation here. \$\endgroup\$