Come to think of it, the beginning of the day should probably be computed in UTC, as that is for instance what ntpd uses to roll-over its statistics on. A configurable offset to that would probably be nice, too. Using UTC has the additional advantage that the DST nonsense never enters the picture.