--- [EMAIL PROTECTED] wrote:
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > --- P Kishor <[EMAIL PROTECTED]> wrote:
> > > On 2/18/07, Neil McLeod <[EMAIL PROTECTED]> wrote:
> > > > I just started using SQLite, and it seems my timestamps are all 5 hours
> > > > ahead of time (i.e. "select current_time" gives me 0:47 when it is 
> > > > actually
> > > > 19:47 here). I guess this is GMT. Is there a way to adjust the time? 
> > > > I'm on
> > > > Windows XP, and the time is listed correctly in my taskbar.
> > > 
> > > by default, time is in UTC. Use 'localtime' modifier for your time.
> > > 
> > > select time('now', 'localtime');
> > 
> > Is there any way to force current_time to display localtime (other than
> > hacking the sqlite source code)?  Some environment setting or PRAGMA
> > or something?
> > 
> 
> CURRENT_TIME does not "display" anything.  It generates a value
> to be stored in the database.  Whether you realize it or not, 
> you want to store time and date values in UTC, not localtime.
> Convert from UTC to localtime at the point where you extract
> the information out of the database to display it to the user.
> 
> And to answer your question:  No, there is no way to get CURRENT_TIME
> to use anything other than UTC.

Thanks for your response.

I'm aware of UTC time handling and time zones. 
I just thought SQLite might support per-connection time zone settings 
to display/set datetime information as many other databases do. 

 http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html
 http://dev.mysql.com/doc/refman/5.0/en/timestamp-4-1.html

 "You can set the current time zone on a per-connection basis, 
 as described in Section 5.11.8, “MySQL Server Time Zone Support”. 
 TIMESTAMP values are stored in UTC, being converted from the 
 current time zone for storage, and converted back to the current 
 time zone upon retrieval."



 
____________________________________________________________________________________
Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel 
bargains.
http://farechase.yahoo.com/promo-generic-14795097

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to