Re: Date Arithmetic in SQL or 4GL
Posted in 2003
Neil Truby wrote: > It's done by representing dates and times internally as a simple number. > It's the number of milliseconds since the assasination of the Archduke > Ferdinand, or something like that. Is this what you meant? DATE values are the integer number of days since day 0 = 1899-12-31. Day 1 was 1900-01-01. DATETIME is represented by a subset of a DECIMAL value which in full would contain yyyymmddHHMMSS.FFFFF. INTERVAL is similar, but different - they're still stored in a DECIMAL, but as a subset of: yyyyyyyyymm mmmmmmmmm dddddddddHHMMSS.FFFFF HHHHHHHHHMMSS.FFFFF MMMMMMMMMSS.FFFFF SSSSSSSSS.FFFFF -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/