|
-
July 22nd, 1999, 04:54 PM
#1
How to get PC Cuurent Time by using C
I understand that I can use the GetCurrentTime class for getting Current time from PC in C++. I just wonder how to write code for getting current time from PC by using C.
Thank you for any help.
-
July 22nd, 1999, 07:29 PM
#2
Re: How to get PC Cuurent Time by using C
-
July 22nd, 1999, 11:00 PM
#3
Re: How to get PC Cuurent Time by using C
Example
/* STRTIME.C */
#include <time.h>
#include <stdio.h>
void main( void )
{
char dbuffer [9];
char tbuffer [9];
_strdate( dbuffer );
printf( "The current date is %s \n", dbuffer );
_strtime( tbuffer );
printf( "The current time is %s \n", tbuffer );
}
Output
The current date is 03/23/93
The current time is 13:40:40
Regards,
Paul Belikian
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
|