Merge pull request #4828 from jreback/dunit2

BUG: enhanced to_datetime with format '%Y%m%d' to handle NaT/nan better
TST: tests for GH4812 (already fixed in master)