Re: subtract two dates to get the number of days
От | Thomas Kellerer |
---|---|
Тема | Re: subtract two dates to get the number of days |
Дата | |
Msg-id | i1kn9t$9e5$1@dough.gmane.org обсуждение исходный текст |
Ответ на | Re: subtract two dates to get the number of days (Jean-David Beyer <jeandavid8@verizon.net>) |
Ответы |
Re: subtract two dates to get the number of days
|
Список | pgsql-sql |
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
В списке pgsql-sql по дате отправления: