this can all be collapsed down, something like:

```
if date_format is None:
        date_formatter = lambda x: x._repr_base
else 
        date_formatter = lambda x: x.strftime(date_format) if notnull(x)

if isinstance(val, (np.datetime64, datetime.datetime)):
       val = date_formatter(lib.Timestamp(val))
```