C# how do i create a DateTime Variable that has the current date, but a different time? [closed]

Timespan is what you need.

            TimeSpan now = DateTime.Now.TimeOfDay;
            TimeSpan time2 = new TimeSpan(15, 23, 30); //(15h:23m:00s)
            TimeSpan dif = time2 - now;

Leave a Comment