On Mon, Jul 28, 2014 at 12:20 PM, Keith Medcalf <kmedc...@dessus.com> wrote: > It may or may not be a valid timestamp depending on what your time > representation is. SQLite does not use UTC (which is an artificial timescale > maintained by a bunch of atomic clocks). SQLite (and most other things that > keep time, other than artificial atomic clocks) use Mean Solar Time.
The word "solar" does not appear on http://sqlite.org/lang_datefunc.html . Instead it's explicitly stated that "Universal Coordinated Time (UTC) is used". ISO-8601 is mentioned in passing, and it's not clear if SQLite3 is intended to parse all ISO-8601 timestamps or if ISO-8601 is merely inspiration. Still, ISTM that "UTC is used" implies handling of leap seconds, and the simplest way to handle them is to parse them but alias them to a neighboring second. (Alternatively SQLite3 could have support TAI or some other time standard that doesn't have leap seconds, and then support conversions to/from UTC, but that wouldn't be easy to use.) FTR, I'm with Jan N.: timestamps with 60 seconds should be parsed, with the extra second "ignored", for some value of "ignored". There's two possible values of "ignored" here: s/60/59/, or s/60/59/ then + 1s. I'm not sure which of those is best. > [...] > Because UTC is a discontiguous scale which "steps" occasionally to keep the > "current" UTC time in sync with "real time" (as in Mean Solar Time), there is > no way to convert between the two without having a massive table of the > discontiguities. [...] The table would hardly be massive (it'd be inaccurate for times before any leap seconds were computed, and it'd be massive as thousands of years pass from now, but who cares). But that's neither here nor there. We just don't need to such a table in SQLite3; it won't matter whether it is massive. We need only be able to *parse* timestamps with extra seconds, because parsing them is better than not. Raising errors is not that useful here: most users who ever run into such timestamps will not really know what to do with them. Yes, the extra seconds need to be handled in some way, and aliasing them to nearby times is plenty good enough. Nico -- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users