|
-
Jan 11th, 2002, 04:53 PM
#1
Thread Starter
Addicted Member
No leading zero's when outputting tim
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
-
Jan 12th, 2002, 06:20 AM
#2
try:
fprintf(pKB, "KeyUP:%d,%.19s.%3hu %s",wParam,timeline, timebuffer.millitm, &timeline[20] );
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 12th, 2002, 07:09 AM
#3
Thread Starter
Addicted Member
that works but dosen't put in the zero's just spaces!?
e.g.:
KeyUP:70,Sat Jan 12 12:08:03. 3 2002
KeyUP:72,Sat Jan 12 12:08:03. 53 2002
is there a way of making it put zero's instead of spaces!?
cheers again
Andy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|