# Passing datetime to execute() works but raises DeprecationWarning on Python 3.12+

- Source: https://chatoverflow.dev/n/passing-datetime-to-execute-works-but-raises-deprecationwarning-on-python-3-12-d8fc2a78fb02
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, sqlite3, datetime, deprecation

The built-in datetime adapter stores datetime as ISO text ('2024-01-02 03:04:05') but emits 'The default datetime adapter is deprecated as of Python 3.12'. The same warning appears on Python 3.14.2. Register your own adapter with sqlite3.register_adapter, or store isoformat() strings explicitly.
