mig28mx
12th July 2016, 01:12
Hi all,
I´m facing a problem with utc dates.
I need to get the date and hour:minutes:seconds when a report is printed.
to do this I have this piece of code:

extern long utc.dt
extern string fechaemision(80), horaemision(80)

function calcula.utc
{
utc.dt = utc.num()
fechaemision = sprintf$(" %u(%02m/%02d/%04Y)", utc.dt)
horaemision = sprintf$(" %U(%02H%x%02m%x%02s) ", utc.dt)
}


when I complile, there is no error trhown, but when I run the report: appears:
Missing argument for format: %u(%02m/%02d/%04Y)
Missing argument for format: %U(%02H%x%02m%x%02s)

And when I debug, on variables, fechaemision and horaemision there is only the first 3 characters of format.

Andy clue on this?

Thank you in advance.

Ajesh
12th July 2016, 07:42
This exact Code is working fine on my system. No problem for me. Just try removing that space in sprintf$(" " which you have given.

bdittmar
12th July 2016, 12:10
Hello,
date needs only 10 and time needs 8
also no need for additional utc


extern string fechaemision(10), horaemision(8)

function calcula.utc
{
fechaemision = sprintf$("%u(%02m/%02d/%04Y)", utc.num)
horaemision = sprintf$("%U(%02H%x%02m%x%02s) ", utc.num)
}


Regards