On 2018/03/22 4:22 PM, Peter Da Silva wrote:
Don't actually need to convert it to datettime if it's already in the right 
format, do you, or does datetime() do some grooming the source needs?

Yes indeed, it's down to "vetting" and in no way needed for the conversion. If datetime(x) understand x and doesn't produce any NULLs, then x is a valid ISO8601 date (or valid-enough for SQLite) and all is fine.

Vetting can however be achieved more simply by a query that doesn't alter the data, to allow research into the origin data and finding the cause.

I never trust the program making the data to avoid the obvious stray character, unneeded quotes, and also things like a date showing leap seconds (which might be understood by the target system) or an invalid day for a month etc. The OP may however know/trust his source data. I'm just overly paranoid. :)



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to