I get data representing the time interval from the service as a string in the form:
1500-1600
This value is from 3 pm to 4 pm.
I will have a list of these, for example,
1200-1300
1300-1400
1400-1500
and I have to present this in the user interface as
12pm - 1pm
1pm - 2pm
2pm - 3pm
Unfortunately, this list may be in random order.
My question is, is there a way to use a DateTime object to be able to convert 24-hour time to 12-hour time, and is there also a way to arrange the time in order?
At the moment, I feel that I will have to write my own parsing function, but I wonder if anyone knows how to do this better? or could advise how they will achieve this.