Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Occurances of one TimeSpan in another

Status
Not open for further replies.

ChewDoggie

Programmer
Mar 14, 2005
604
0
0
US
G'morning all,

I'm trying to determine how many times in a 24 hr day that that given timespan occurs.

So, if the timespan was 00:15:00 (15 minutes), then 15 minutes occurs 4 times per hour, 24 hours in a day, so a 15 minutes timespan occurs 96 times in a 24 hr day.

How do I calculate this ?

Chewdoggie


10% of your life is what happens to you. 90% of your life is how you deal with it.
 
I was able to solve this:

TimeSpan ts24Hrs = new TimeSpan(24, 0, 0);
TimeSpan MTimeSpan = TimeSpan.Parse(cJob.Attributes["ResubmitDelay"]);
retryCount = Convert.ToInt32(ts24Hrs.TotalSeconds / MTimeSpan.TotalSeconds);

Chew

10% of your life is what happens to you. 90% of your life is how you deal with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top