I think you need something like;
DateTime dt1 = DateTime.Parse("09:00 AM");
DateTime dt2 = DateTime.Parse("06:00 PM");
while (dt1 <= dt2)
{
Console.WriteLine(dt1.ToString("hh:mm tt"));
dt1 = dt1.AddHours(1);
}
Output will be;
09:00 AM
10:00 AM
11:00 AM
12:00 PM
01:00 PM
02:00 PM
03:00 PM
04:00 PM
05:00 PM
06:00 PM
Here's a demonstration.
I'm sorry but I don't understand why you interested in TimeSpan
on this case. It is a duration in time. You need to get every hour times with DateTime
.