Fix encoding for datetime64[ns]