I am outputting time in this format:

KeyDOWN:16,Thu Jan 03 16:33:51.284 2002

but on certain lines where it outputs the seconds.milliseconds the leading zero..if there is one is sometimes removed! e.g.

it will output: 16:33:51.23
when it should really be: 16:33:51.023

this makes it difficult for me later ....why would it be doing this?

This is the timing code that i am using:
//Global
/*Timer Elements*/
struct _timeb timebuffer;
char *timeline;


//In the function

//Timer Elements
_ftime( &timebuffer );
timeline = ctime( & ( timebuffer.time ) );




fprintf(pKB, "KeyUP:%d,%.19s.%hu %s",wParam,timeline, timebuffer.millitm, &timeline[20] );

am i doing something wrong?!?!? or is there another way?

cheers in advance for any insite into this!

Andy