how can i make a countdown to the new year 2021?

Maybe something like this, I didn’t run your code, but I suspect that the issue is the comparison you’re doing with afterNewyear

if ((newyear - starttime1).TotalDays  > 0)//if newyear hasn't been reached
        {
            timer1.Start();
        }
        else if (Math.Abs((starttime1-newyear).TotalDays) < 1)//If currently if the new year day
        {
            timer1.Stop();
            label1 = "Happy New Year 2021";
        }
        else
        {
            //start the countdown again for next year//   
        }

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top