Ensure dates are dates, not strings

In DB API we have a check which removes tzdata from dates, however
in some cases these dates are strings rather than datetime objects.
This will detect and correct these instances.

Fixes bug 1203069

Change-Id: I8ca955f6eb11e4b955ece9ec0822cda000b38f20
Merge "Ensure dates are dates, not strings"