While timestamps (seconds since 1970) need less storage space, I tend
to store dates and times with this format:

2010-09-04 09:15:37

This is more readable for ad-hoc queries, and you can easily use range
operations with a simple BETWEEN or a "<=" and ">=". SQLite has a
built-in function to generate this timestamp with the current date and
time within the current time zone:

SELECT datetime('now', 'localtime') ;

Zanardo.

On Sat, Sep 4, 2010 at 8:31 AM, Mike Zang <mikez...@yahoo.co.jp> wrote:
> I try to convert data to SQLite3 for iPad, please give me some detail
> suggestion.
>
> I think that I can save date value as below to SQLite3, I want to know
> which is better, or anything else if you have good idea.
>
> 1. integer as seconds since 1970
> 2. integer as days since 1970
> 3. string as '2010-09-03'
> 4. string as '10-09-03'
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to