
The date/times that I was wanting to deal with were in the ISO 8601 format. Specifically, this is what a sample date/time string would look like:
In my case, as seen above, I was storing the date, time and fractional seconds. The time component was in the UTC time zone.
MySQL
To produce the above with MySql date and time functions the format string looked like this:
SQLite
Moving to SQLite date functions, the format string became:
On the most part the format strings were similar. In fact the date component of the format string was identical. The time component was different however and this is where I tripped up initially. With SQLite, the 'fractional seconds' field was represented by a single substitution (%f) instead of two as used in MySQL (%s.%f).
So lesson learned! It's definitely worthwhile reading documentation before making any assumptions about date/time format strings, whether it be for MySQL, SQLite or any other database or programming language.
-i