Enrico Thierbach <e...@open-lab.org> wrote: > On 08.03.2011, at 14:29, Igor Tandetnik wrote: >> select datetime('2011-03-12 14:00', 'utc'), datetime('2011-03-13 14:00', >> 'utc'); >> 2011-03-12 19:00:00 | 2011-03-13 18:00:00 >> >> That's for EST (New York time), which switches to DST on 3/13 at 2 am. > > Your example, however, is just the other way around :) I want to enter a time > without explicitely stating a timezone, e.g. > "2011-03-13 19:00:00", > and have sqlite convert it correctly into datetime('2011-03-13 15:00', 'utc')
You seem to misunderstand how modifiers work. In my example, 2011-03-12 14:00 is the time in local timezone (which happens to be EST for me), and SQLite converts it to time in UTC. 'utc' is in effect a conversion operator. We are currently 5 hours behind UTC (aka UTC-5), so 14:00 EST is 19:00 UTC. Once the DST is in effect, we will be in UTC-4, and 14:00 EDT will be 18:00 UTC. Which is what my example demonstrates. > In other words: I would like to state in which place a time is meant to be > meaningful SQLite doesn't support arbitrary time zones. It only knows how to convert between UTC and local time zone, as reported by the OS. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users