Re: [sqlite] time is off

2006-09-18 Thread drh
TiNo <[EMAIL PROTECTED]> wrote:
> example:
> 
> sqlite> select datetime('now');
> 2006-09-18 10:11:48
> sqlite> select datetime('now','utc');
> 2006-09-18 08:11:52
> sqlite> select datetime('now','localtime');
> 2006-09-18 12:11:58
> 
> 
> select datetime('now') shows utc time, Localtime shows my localtime,
> but now,utc is off. It should be the same as datetime('now'). Why is this?

The 'utc' modifier interprets the time to the left as localtime
and converts it to UTC.  Since in the example above, the time to
the left was already in UTC, you are doing a double-conversion.

--
D. Richard Hipp   <[EMAIL PROTECTED]>


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



Re: [sqlite] time is off

2006-09-18 Thread Jay Sprenkle

On 9/18/06, TiNo <[EMAIL PROTECTED]> wrote:

example:

sqlite> select datetime('now');
2006-09-18 10:11:48
sqlite> select datetime('now','utc');
2006-09-18 08:11:52
sqlite> select datetime('now','localtime');
2006-09-18 12:11:58


select datetime('now') shows utc time, Localtime shows my localtime,
but now,utc is off. It should be the same as datetime('now'). Why is this?


Did you set your locale on your machine?
It can't convert to localtime correctly without being set for the
right time zone.

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



[sqlite] time is off

2006-09-18 Thread TiNo

example:

sqlite> select datetime('now');
2006-09-18 10:11:48
sqlite> select datetime('now','utc');
2006-09-18 08:11:52
sqlite> select datetime('now','localtime');
2006-09-18 12:11:58


select datetime('now') shows utc time, Localtime shows my localtime,
but now,utc is off. It should be the same as datetime('now'). Why is this?