When you will include this you will be able to use a function known as getlocaltime() as well as a class Systemtime. Now you just have to create an object of SYSTEMTIME class and call getlocaltime function and pass the address of the object in this function and all the data will be stored about time and date in the object. Now you just have you use the date. Following is the example:
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{
SYSTEMTIME obj;
Getlocaltime(&obj);
cout<< obj.wDay <<endl ;
cout<< obj.wMonth <<endl ;
cout<< obj.wYear <<endl ;
cout<< obj.wHour<<endl; //wMinute and wSecond can also b used
}What Video Click HERE:
Also, understand that what is library or header filers Click HERE
No comments:
Post a Comment