LocalDate and DateTime serialization improvements.

Don't allocate unnecessary memory during parsing.