Search This Blog

Sunday, 23 August 2020

Adding the date and timing universal constant

 #include<iostream>

#include<ctime>

using namespace std;

int main()

{

time_t now = time(0);

char*dt=ctime(&now);

cout<<"the local date and rime is: "<< dt <<endl;

tm*gmtm=gmtime(&now);

dt=asctime(gmtm);

cout<<"the UTC date and time is :  "<< dt<<endl;

}


No comments:

Post a Comment

Search This Blog

Contact Form

Name

Email *

Message *

Popular Posts