beginOfDay and endOfDay functions.