fix earliest/latest time converstion.