I’m working on timetabling application and I have a class:
called ClassOption representing a possible time to have a class.
with fields(/properties): Day, StartTime, EndTime, and Weeks.
Now Day is easy it’s type is DayOfWeek
Weeks is going to require me to make a custom class because it is represented by the universities own in-semester weeks notation or in a calendar week, but basically will come down to a set of integers, eventually.
But what calls should I use for StartTime and EndTime.
They are a time, but without any Date information.
DateTime seems like a reasonable choice, but they could be on any date. (/many dates)
By business logic they are both on the hour, but that doesn’t really matter
If you’re happy to use a third party library which isn’t quite at v1 yet, I’d like to plug Noda Time. You’d use the
LocalTimestruct.If you’re stuck with the base class library, you might want to use
TimeSpan, or you could stick withDateTime. Obviously I think thatLocalTimewould be a more elegant solution though 🙂Oh, and if you do use Noda Time, please let us know if you have any feature requests or comments…