Improve DateTime serialization for SQLite

Fixes #711