Methods computing the beginning or the end of day