JP wrote:
John Stanton wrote:

I endorse Jay's approach. In our web page software using Sqlite everything is TEXT except for dates in Sqlite format. We use declared types to indicate classes of text, such as decimal numbers and dates. There are no radix conversion involved in data manipulation (apart from dates), and we use a set of routines which perform decimal arithmetic on text strings so that we are not trapped in the floating point bearpit.

It all fits in very elegantly with Sqlite and makes web page generation simple. Once you appreciate that Sqlite's typing makes it easier, not harder, it is easier.
JS

Jay Sprenkle wrote:

On 5/10/06, sqlite <[EMAIL PROTECTED]> wrote:

We're C++ programmers and C++ is all about data types.
It's a statically typed language.


I dealt with it pretty simply in my application. It produces web pages
and web pages are text. Anything I retrieve is always retrieved as text.
No conversions needed, nice and simple.

Regarding dates, given the many different ways DATES are handled across platforms, I stick to using dates in char format, always stored as YYYYMMDD (optionally with HHNNSSss with 24-hour format, and always UTC). Easy to sort, easy to search, easy to handle, and very portable. I do have to create routines in the particular programming language to do the conversion, data entry and formatting, but it saves me a lot of work knowing that storage is always the same.

jp


We have agonized over date formats over the years, but find the Sqlite way correct because it is theoretically sound by using a correct Julian method. We got into trouble using Gregorian dates in char format when we had to work internationally and present dates in the Middle East and Asia for example. Sqlite's method make no assumption that Gregorian dates are being used and can fit in with any of the world's date systems. It also makes relatively simple the generation of day of the week. number of working days in this accounting period, date differences etc.

I also like the ingenious way that date and time have been folded into one FP number.
JS

Reply via email to