inherit
66746
0
Oct 7, 2012 14:05:38 GMT -8
«The Silver Lining»™
^ Me !!!!
1,338
December 2005
chrisrulez001
|
Post by «The Silver Lining»™ on Nov 29, 2010 8:11:36 GMT -8
Hi, I was wondering how you get the system time in C++? Also when C++ has the system time can it be altered? (Can be programmatically altered, system time + 1 hour). EDIT: Found A Code That Does This: #include <iostream> #include <Windows.h>
using namespace std;
int main() { SYSTEMTIME* time = new SYSTEMTIME; GetSystemTime(time); cout << "\tDay: " << time->wDay << endl; cout << "\tMonth: " << time->wMonth << endl; cout << "\tYear: " << time->wYear << endl << endl; cout << "\tHour: " << time->wHour << endl; cout << "\tMinutes: " << time->wMinute << endl; cout << "\tSeconds: " << time->wSecond << endl; cout << "\tMiliseconds: " << time->wMilliseconds << endl; cin.get(); return 0; } More info on this website www.ehow.com/how_2190605_use-date-time-c-program.html
|
|