Timespan is what you need.
TimeSpan now = DateTime.Now.TimeOfDay;
TimeSpan time2 = new TimeSpan(15, 23, 30); //(15h:23m:00s)
TimeSpan dif = time2 - now;
More Related Contents:
- How do I get the correct time in C#
- Convert DateTime to Date string “dd/mm/yyyy”
- How do I calculate someone’s age based on a DateTime type birthday?
- Parse string to DateTime in C#
- How to truncate milliseconds off of a .NET DateTime
- Calculate the number of business days between two dates?
- Conversion of a datetime2 data type to a datetime data type results out-of-range value
- format date in c#
- Find if current time falls in a time range
- How to compare DateTime in C#?
- Environment.TickCount vs DateTime.Now
- How do I loop through a date range?
- How to Validate a DateTime in C#?
- Parse datetime in multiple formats
- How do I get the time difference between two DateTime objects using C#?
- Why DateTime.AddHours doesn’t seem to work?
- DateTime format to SQL format using C#
- How to find the 3rd Friday in a month with C#?
- Using DateTime in a SqlParameter for Stored Procedure, format error
- How does DateTime.ToUniversalTime() work?
- Converting string format to datetime in mm/dd/yyyy
- why does DateTime.ToString(“dd/MM/yyyy”) give me dd-MM-yyyy?
- datetime to string with time zone
- Parse a string containing date and time in a custom format
- Where’s the DateTime ‘Z’ format specifier?
- Getting time span between two times in C#?
- C# date formatting is losing slash separators
- Set Default DateTime Format c#
- Adding a Time to a DateTime in C#
- Specify Date format in MVC5 (dd/MM/yyyy)