Quote:
How to check year is changed from date
Assuming your code is corrected, you do not test if the year have changed or not, you test if first day of year.
That test fail if launch more than once that day, and it also fail if not launch that day for any reason.
var lasttest;
var today = DateTime.Now;
if (lasttest.year < today.year)
{
}
lasttest = today;
This code success in any case.