input 15:20:30
to to convert to second
input 15:20:30
to to convert to second
var dt = DateTime.Now;
var ticks = dt.Ticks;
var seconds = ticks/10000000;
Each tick is 100 nanoseconds.
Seeing as though you haven't specified the question properly I have interpreted it to represent 15 hours 20 minutes and 30 seconds, as opposed to DateTime.Now. (Obviously this is the same as "How many seconds since midnight")
TimeSpan MySpan = new TimeSpan(15, 20, 30);
MySpan.TotalSeconds;
Although if you're only wanting the Seconds from the current DateTime.Now (this is not the TotalSeconds, just the current minutes seconds), just use:
DateTime.Now.Second
Not sure what you really want, but if you want to compute the number of seconds from 15 hours, 20 minutes and 30 seconds you can do this:
Int32 GetSeconds(Int32 hours, Int32 minutes, Int32 seconds) {
return ((hours*60) + minutes)*60 + seconds;
}