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.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


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

Reply via email to