Hi,
Currently, the Time interface is a bit assymetric. There are a lot of get method, but no setter.
One could use the Time(year, month, day…) constructor to overcome the missing setters.
However, I think Time still miss a setDayOfWeek method, since the constructor doesn’t provide this functionality.
Hopefully this can be easily added by this method:
void Time::setDayOfWeek(int newDayOfWeek)
{
// Go back to previous sunday
millisSinceEpoch -= getDayOfWeek() * 86400000;
// And set the current day of week
millisSinceEpoch += newDayOfWeek * 86400000;
}
This of course, will ignore DST change if it happened during the week, but handling them would require a re-normalization step, using mktime/millisToLocal, which is not working in outside the 1970/2038 period.