Createing some sort of schedulling is quite common task (well, at least
for me), and this seems to be light but nice-to-have-out-of-the-box
facility.
+1 from me, but lets hear from library authors first.
Thanks,
Andrey
On Wed, 02 Apr 2008 01:51:30 -0600, Jean-Pierre Bergamin
Hello everyone
While implementing a job scheduler that has to start jobs at specific times (i.e. daily at 08:15) and during specific time ranges (every Monday between 16:20 and 18:00), the need for two new concepts that represents a time (detached from a date) and a time range between two time_of_day came up. While time_duration almost fits these needs, there are some things that we had to take into account:
- A time_of_day must be normalized to only allow hours >= 0 && hours < 24 - Only the substract operator makes sense to calculate the duration between to times (15:30 - 12:00 = 3 hours and 30 minutes). 12:20 + 15:32 does not make sense.
The implicit conversion to time_duration also allows the usage of time_of_day to create ptime instances (which is IMHO more "understandable" then using time_duration): ptime some_time(date(2008, 4, 1), time_of_day(14, 20, 0)); [snip]
I think these concepts would fit well into the date time lib. What do you think?
Regards James