I am trying to create this list in c#, add this is what I am at now
public static List<string> GetCurrentTime()
{
var start = DateTime.Today;
List<string> L = new List<string>();
var clockQuery = from offset in Enumerable.Range(0, 48)
select start.AddMinutes(30 * offset);
foreach (var time in clockQuery)
L.Add(time.ToString("hh:mm"));
return L;
}
This code will generate this list, and I am stuck here, how can I generate the above list which the first value should always start (1 hour after now – 1 hour 30min)
2
Answers
I set my code like the following:
This will result to the following list and it worked for me
If you want time from mid-night :