Monday, May 24, 2021

get current date of system in c++ cpp

 #include<iostream>

#include<ctime>
using namespace std;
int main()
{
    time_t now=time(0);
    cout<<"now is :"<<now<<endl;
    chardate_time=ctime (&now);
    cout<<date_time;
    
    return 0;
}


No comments:

Post a Comment