Fix iterating over DateTime by doing strict checking for Time objects

- Fixes #13667