Using _strtime and _strdate to get the time

0 votes
31 views
asked Dec 17, 2013 in C++ by joyl

1 Answer

0 votes
answered Dec 17, 2013 by Ali

You Can make clock in C++ by using _strtime and also get current date by using _strdate 
 

#include 
#include 

using namespace std;

int main( )
{
    char dateStr [9];
    char timeStr [9];
    _strdate(dateStr);
    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.
...