earliest and latest functions added for choosing from DateTimes

As discussed on mailing list.