Re: SQLite date fields

2010-11-28 Thread Tim Roberts
Duncan Booth wrote: >Tim Roberts wrote: > >>>However, when it comes to writing-back data to the table, SQLite is >>>very forgiving and is quite happy to store '25/06/2003' in a date >>>field, >> >> SQLite is essentially typeless. ALL fields are stored as strings, >> with no interpretation. Y

Re: SQLite date fields

2010-11-26 Thread Alan Harris-Reid
To all those who have replied on this thread - many thanks. It looks as though I've got to look further into date objects, SQLite's native date functions, detect_types, etc.. Regards, Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite date fields

2010-11-26 Thread Tim Chase
On 11/26/2010 07:20 AM, Duncan Booth wrote: Tim Roberts wrote: SQLite is essentially typeless. ALL fields are stored as strings, with no interpretation. You can store whatever you want in any column. The column types are basically there to remind YOU how to handle the data. Not all fields

Re: SQLite date fields

2010-11-26 Thread Duncan Booth
Tim Roberts wrote: >>However, when it comes to writing-back data to the table, SQLite is >>very forgiving and is quite happy to store '25/06/2003' in a date >>field, > > SQLite is essentially typeless. ALL fields are stored as strings, > with no interpretation. You can store whatever you want

Re: SQLite date fields

2010-11-25 Thread Tim Roberts
Alan Harris-Reid wrote: > >I am having design problems with date storage/retrieval using Python and >SQLite. > >I understand that a SQLite date column stores dates as text in ISO >format (ie. '2010-05-25'). Only if you store it that way. >So when I display a British date (eg. on a web-page) I

Re: SQLite date fields

2010-11-25 Thread CM
> However, when it comes to writing-back data to the table, SQLite is very > forgiving and is quite happy to store '25/06/2003' in a date field, but > this is not ideal because a) I could be left with a mixture of date > formats in the same column,  b) SQLite's date functions only work with > ISO f

Re: SQLite date fields

2010-11-25 Thread MRAB
On 25/11/2010 00:45, Alan Harris-Reid wrote: Hi, I am having design problems with date storage/retrieval using Python and SQLite. I understand that a SQLite date column stores dates as text in ISO format (ie. '2010-05-25'). So when I display a British date (eg. on a web-page) I convert the dat

SQLite date fields

2010-11-24 Thread Alan Harris-Reid
Hi, I am having design problems with date storage/retrieval using Python and SQLite. I understand that a SQLite date column stores dates as text in ISO format (ie. '2010-05-25'). So when I display a British date (eg. on a web-page) I convert the date using datetime.datetime.strptime(mydat