Anbody used ifx_dttofmtasc() successfully?

Started by David H., September 07, 2009, 01:44:17 PM

Previous topic - Next topic

David H.

Hi All,

I'm using v2.11 on Windows and am having some trouble getting ifx_dttofmtasc() to work as expected. It does something and I get no errors, but:-

CURRENT YEAR TO SECOND formatted with %H:%M:%S gives me 00:00:00 and no errors.
CURRENT formatted with %Y-%m-%d %H:%M:%S gives me 0000-00-00 00:00:00 and no errors.

Whatever I pass in seems to get expanded as zero's. I'm calling via a runner function. I'm sure my format string is ok, but either I'm passing the DATETIME from 4GL to C incorrectly (using popdtime) or this function is faulty...

Any ideas anyone?

Regards,

David

Sebastien F.

David,

This function is QA tested and should work with the format strings you are using.

Could you please dump the content of your datetime structure?

Seb

David H.

Hi Seb,

I never used popdtime() before... Your documentation confused me as it defined:-

void popdtime(dtime_t *dst, int size);

But I did a web search and found some non 4js documentation as:-

void popdtime(dtime_t *dst, int qual);

I'd interpreted size as size dtime_t, certainly not the size of the qualifier! I actually don't see what the 2nd argument is there for anyway... Isn't the datetimes qualifier stored in the dtime_t structure already, i.e. dtime_t.dt_qual?

Anyways when I set the 2nd argument to a valid qualifier (YEAR TO FRACTION) then my function works as expected.

Cheers,

David

Sebastien F.

David,

The documentation needs some clarification about this "size" argument, will be fixed.

Sorry for that.
Seb