Re: Informix on AIX
Posted in 1997
Chengteh Lee wrote: > > I installed > INFORMIX-ESQL/C 5.00.UC2, > INFORMIX-4GL 4.10.UD3 > INOFRMIX-SE 5.00.UC3 > on AIX and complied our applications (in C) for some of our clients. > > We use infomix function, rdefmtdate, to convert Date string, > rdefmtdate(&ldate, "mm-dd-yyyy", str_date); > > I have input str_date = 07-11-1997, and informix return > ldate = 2104819714. I don't have much information > about this informix version. > I wonder if there are people using similar version of > Informix. Please tell me if this version support 4 digit year. > If the answer is yes, why I got this crazy return value? > > ps. I set the enviornment variable: DBDATE=MDY4-. > > Thanks! > > Chengteh > > ------------------------------------------------------------ > AcuStaf Corporation Automated Staffing Systems > 5001 West 80th Street Payroll, Scheduling > Minneapolis, MN 55437 Time/Attendance ... > 612-831-4122 ext 248 http://www.acustaf.com > ------------------------------------------------------------ I can't really explain it, but that number does seem familiar. It sounds like the maximum value for a long integer on most UNIX systems. (as defined in /usr/include/limits.h). 7-11-97 shouldn't exceed this value (if it's a DATE type informix variable, which if I recall correctly is the number of days since 1900.) Is ldate defined as a long? If I were you, I'd double-check Informix docs as to DBDATE and see if other dates gave you similar results. If that seems right, double-check that str_date really contains the string you think it does (Do a printf or fprintf() immediately before the call to rdefmtdate().) -- - Danny Wright danwright@bigfoot.com #include <stddisclaimers.h> "If you get confused, then listen to the music play." - Robert Hunter "Confusion will be my epitaph, as I crawl a cracked and broken path. If we make it we can all sit back and laugh, but I fear tomorrow I'll be crying." - Pete Sinfield "We're in a state of confusion." - Ray Davies