On 08.03.2011, at 14:29, Igor Tandetnik wrote:

> Enrico Thierbach <e...@open-lab.org> wrote:
>> I have to add a number of times into the database. They come from "real 
>> live" sources, that, for example, say: "Sunday, March
>> 13th, 2pm", or "Sunday, April 3rd, 2pm". 
>> 
>> Here in Central Europe we switch to DST on the last weekend of March, 
>> therefore the first time is "2011-03-13 14:00 UTC+1" (or
>> "2011-03-13 14:00 CET"), while the latter is "2011-04-03 14:00 UTC+2" (or 
>> "2011-04-03 14:00 CEST"). 
>> 
>> Now sqlite already knows about DST. Does anyone see a way to use that 
>> already? I would hate to reinvent the wheel and to code
>> this myself :) 
> 
> 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.
> -- 
> Igor Tandetnik
> 

Thanks, Igor. 

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'), 
because this time is meant to be meaningful in New York, and "2011-03-13 15:00" 
is on DST already. 

In other words: I would like to state in which place a time is meant to be 
meaningful, and have sqlite come up 
with the proper timezone and DST correction depending on place and time. Sorry 
for not making that clear in the beginning.

Is there a way to do that? How do you guys solve this?

/eno 


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

Reply via email to