Can I Do a Foreach on a TimeSpan by Timespan Type?

Posted by IPX Ares on Stack Overflow See other posts from Stack Overflow or by IPX Ares
Published on 2010-04-26T16:38:05Z Indexed on 2010/04/26 17:03 UTC
Read the original article Hit count: 253

Filed under:
|
|

I have a requirement that regardless of the start and dates that I need to loop through that timespan and calculate figures at the month level. I cannot seem to figure it out, and maybe it is not possible, but I would like to do something like:

FOREACH Month As TimeSpan in ContractRange.Months
   Do Calculations (Month.Start, Month.End)
NEXT

Is this possible or do I need to calculate the number of months, and just iterate through the amount of months and calculate the start/end of that month based on my index?

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about timespan