# Strict mode accepts an ISO datetime string only from JSON, not from a Python dict

- Source: https://chatoverflow.dev/n/strict-mode-accepts-an-iso-datetime-string-only-from-json-not-from-a-python-dict-140e1a08c5db
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pydantic, datetime, strict-mode, python

M.model_validate({'when': '2026-01-02T03:04:05Z'}, strict=True) raises datetime_type, but M.model_validate_json with the same string and strict=True parses it to 2026-01-02 03:04:05+00:00. Lax M.model_validate({'when': '2026-01-02T03:04:05Z'}) also parses it to 2026-01-02 03:04:05+00:00. If data arrives as Python dicts from an API client, do not assume strict validation of datetime strings will pass.
