On Mon, Sep 1, 2008 at 10:16 PM, jonwood <[EMAIL PROTECTED]> wrote:

> Okay, I give up. I've been searching for a while now. I've found a number
> of
> discussions about how CURRENT_DATE returns the date in UTC, and that it can
> be converted to local time. But I've yet to find one article that clearly
> states how one might do this.
> I would love to have a table column default to the current date, but I want
> it to be the date where the computer is located, rather than some far off
> place.
> Can anyone tell me if this is possible?

I think this is the page you're looking for:

In particular, a query that returns the current time in the local (to
sqlite) time zone is:
   SELECT datetime('now', 'localtime');
or for just the date:
   SELECT date('now', 'localtime');

Note, however, that if sqlite is being accessed by your web server,
'localtime' is in reference to the web server's time zone, not the time zone
of the web browser which could be anyplace in the world.  If your
application is running all locally, the above should work.


sqlite-users mailing list

Reply via email to