I was wondering how to get the current date(seconds/hours/days/years etc..) in my code. I just started learning c++ so I don't have any real experience at all. I would really like to know It becouse I am trying to finish my first (tiny) program, I need the program to display the current date.
Just like this:
#include <stdio.h>
#include <iostream.h>
int main()
{
int age;
int year= // this is where I want the code to put the current date
cout<<"Please enter your date of birth";
cin>>age;
cin.get();
int (age=year-age);
cout<<"You are "<<age; cout<<" years old";
cin.get();
return 0;
}
I know It looks kinda noob-like but I really need to know..
You can post a reply or mail me at: [email protected]