Re: Max value of DATE?
Posted in 1996
Nils Myklebust wrote: > > pcarter@hpcc01.corp.hp.com (Preston Carter) wrote: > > :What is the maximum value of a DATE? > > :Is this platform-dependent? > > :Is there a macro in any Informix-supplied ".h" file that > :equates to this value for one's platform? > > :Thanks. > > A date is stored internally as a 32 bit integer representing the > number of days from 1899.12.31 (+ and -). > This should have enabled dates both backwards and forwards for a quite > long time. It is however limited by the engine to 0001.01.01 - > 9999.31.12. As far as I know this is the same on all platforms and > versions of Informix. I know of no macro for any of these values. > There may be one, but I don't program in C (if I can avoide it). > > Nils.Myklebust@idg.no <- New E-mail adress > NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway > My opinions are those of my company Hi Nils, the limitation that the year of the date must fit in a 4 byte string started with version 5.x. With version 2.1 there was no DATETIME datatype and very often the developer of applications added seconds to their date values to get a datetime field. Currently calculations with date fields are restricted, but since we have a datetime datatype there is no need to make calculations. I know of no macro for the highest value, too. But you can get it with the following: long maxVal_l; rdefmtdate( &maxVal_l, "mmm.dd.yyyy", "dec 31 9999" ); The next day would preoduce the error code -1218 ( value too large ). Bye Stefan stefan@sweidi.weideneder.de