I'm trying to output the dates of all Mondays this year, but my if
element won't work with the conditions I'm giving it.
This is my code:
static void Main(string[] args)
{
var dagEtt = new DateTime(DateTime.Now.Year, 1, 1);
while (dagEtt <= DateTime.MaxValue)
{
if (dagEtt == DayOfWeek.Monday)
Console.WriteLine(dagEtt);
dagEtt = dagEtt.AddDays(1);
}
}