ESQL: Problems with dtcurrent/dttoasc
Posted in 1994
Dear Informixers, I am having a problem with the "dtcurrent" and/or "dttoasc" functions in ESQL/C. The behaviour is different in 4.1 and 5.01. The following code is supposed to deliver the current time in the format "hh:mm": #include <stdio.h> #include <datetime.h> main() { EXEC SQL BEGIN DECLARE SECTION; datetime hour to minute zeit; EXEC SQL END DECLARE SECTION; char zeit_str[6]; zeit.dt_qual = TU_DTENCODE(TU_HOUR, TU_MINUTE); dtcurrent(&zeit); dttoasc(&zeit, zeit_str); printf("%s\\n",zeit_str); } This works with 5.01, but with ESQL 4.1 (and C4GL 4.1), the result is always "00:00". Curiously, if I work with "year to minute", the correct result is returned. Platforms: SNI RM400, SINIX 5.41, ESQL 5.01, C4GL 4.10 SNI MX300, SINIX 5.24, ESQL 4.10, C4GL 4.10 Any ideas? Regards, Richard -- +----------------------------+-------------------------------------------+ | Dr. Richard Spitz | INTERNET: spitz@ana.med.uni-muenchen.de | | EDV-Gruppe Anaesthesie | Tel : +49-89-7095-3421 | | Klinikum Grosshadern | FAX : +49-89-7095-8886 | | 81366 Munich, Germany | | +----------------------------+-------------------------------------------+