Using _strtime and _strdate to get the time
This tip submitted by Ali Jafar on 2011-09-16 14:49:58. It has been viewed 27259 times.
Rating of 5.6 with 394 votes
You Can make clock in C++ by using _strtime and also get current date by using _strdate
using namespace std;
int main( )
char dateStr ;
char timeStr ;
cout<< "The current date is " << dateStr ;
_strtime( timeStr );
cout << "\nThe current time is "<
For security sensitive programs, consider using _strtime_s and _strdate_s instead.
Help your fellow programmers! Add a tip!