Jean-David Beyer wrote on 14.07.2010 14:37:
> My dates are of the form yyyy-mm-dd and such.
Storing a date as a string is never a good idea.
> And I want to do things like adding or subtracting days, months, or years to it or from it.
>Also the logical comparisons.
Which is all a piece of cake when you use the proper datatype
> Years ago, I made a C++ data type that allowed a date datatype where I
> could add, subtract, and so on.
> I use it in programs that do not necessarily use a database,
To be honest: I expect the programming language to support those things.
> but also in programs that do when the computations are the big part of the cpu load,
> as contrasted to just "gentle" massaging of existing data.
I would expect doing "date maths" with strings is wasting more CPU than using a native date datatype.
Just my €0.02
Thomas