Find Occurances of one TimeSpan in another

  • Thread starter Thread starter Matt Connor
  • Start date Start date
M

Matt Connor

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 ?
 
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 ?

All you need is number of minutes in a day divided by the timespan in
minutes, unless I've missed something?
 
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 ?

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);
 
All you need is number of minutes in a day divided by the timespan in

minutes, unless I've missed something?



--

Jeff Gaines Wiltshire UK

If it's not broken, mess around with it until it is

No, you got it, Jeff !
 
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 ?

There must be some details which have not been provided. It appears you are only
considering timespans which start exactly on the hour, quarter past the hour,
half past the hour, and quarter 'til the following hour. Any sixty minute period
can contain 45 different 15 minute timespans.

regards
A.G.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

TimeSpan in C# 5
timespan issue 11
TimeSpan Problem 5
TimeSpan object question 6
Calculating time 2
Working with TimeSpan 1
Timespan Problem 7
Formatting TimeSpan in a DataGrid 3

Back
Top