AnsweredAssumed Answered

_time_ticks_to_xdate

Question asked by Marcos Di Fazio on Dec 26, 2011
Latest reply on Dec 28, 2011 by Marcos Di Fazio

Hi, 

I have some troubles with _time_ticks_to_xdate function.

 

The following code can be used as demostration 

MQX_TICK_STRUCT stTime;MQX_XDATE_STRUCT xdate0;MQX_XDATE_STRUCT xdate1; xdate0.YEAR = 1970;xdate0.MONTH = 1;xdate0.MDAY = 1;xdate0.HOUR = 0;xdate0.MIN = 0;xdate0.SEC = 0;xdate0.MSEC = 1;xdate0.USEC = 800;xdate0.NSEC = 0;xdate0.PSEC = 0; _time_xdate_to_ticks(&xdate0,&stTime);_time_ticks_to_xdate(&stTime,&xdate1);

 After the conversion, xdate0 is diferent from xdate1

 

I see that USEC > 500 (also NSEC > 500) result in adding one to the milliseconds and random numbers in the minors fields (nsec, psec)

 

Here is the numeric result of the code above

Resultados :
Campo  Xdate0     Xdate1
Año:       1970         1970
Mes:      1                1
Dia:        1                1
Hor:        0                0
Min:        0                0
Seg:       0                0
msg:      1                2
usg:       800            6784
nsg:       0                 35336
psg:       0                 18052

Any help would be apreciated

I suspect same isue in psp functions

_psp_ticks_to_milliseconds,

_psp_ticks_to_microseconds,

_psp_ticks_to_nanoseconds and

_psp_ticks_to_picoseconds

 

Regards

Outcomes