convert datetimes to date for proper calculation