Re: [sqlite] sqlite: current_time is off

2007-02-19 Thread drh
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]
-



Re: [sqlite] sqlite: current_time is off

2007-02-18 Thread Joe Wilson
--- 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?


 

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]
-



Re: [sqlite] sqlite: current_time is off

2007-02-18 Thread P Kishor

On 2/18/07, Neil McLeod <[EMAIL PROTECTED]> wrote:

Hello,

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');



--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

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