|
-
Jan 9th, 2008, 03:20 PM
#1
Thread Starter
Addicted Member
Date and Time Now
can someone plz give me the code to find out the date and time today (now) in C++? thanks
Last edited by perito; Jan 9th, 2008 at 03:26 PM.
-
Jan 9th, 2008, 03:28 PM
#2
Re: Date and Time Now
Code:
#include <stdio.h>
#include <time.h>
int main( )
{
char dateStr [9];
char timeStr [9];
_strdate( dateStr);
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n", timeStr);
}
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Jan 9th, 2008, 03:29 PM
#3
Thread Starter
Addicted Member
Re: Date and Time Now
sorry but Im a newbie :S
is this is C or C++?
I need it in C++
thx
-
Jan 9th, 2008, 03:36 PM
#4
Re: Date and Time Now
That would be compilable in both C and C++.
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
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
|