timeGetTime

Jun 22, 2011 at 4:00pm
Hi all! Can you tell me please ? How can I get system time in Linux ? Is there any function like timeGetTime in Windows ?

Best regards
holtaf
Jun 22, 2011 at 4:29pm
Will the standard C time functions work for you?

http://www.cplusplus.com/reference/clibrary/ctime/
Jun 26, 2011 at 8:24pm
You can get you system time using the standard library. Foe example:

1
2
3
4
5
6
7
8
9
10
11
int main(){
	time_t rawtime;
	tm* TimeNow;
	
	time(&rawtime);
	TimeNow = localtime(&rawtime);
	
	std::cout <<"Now: "<< TimeNow->tm_hour<<":"<<TimeNow->tm_min<<endl;
	
	return 0;
}
Topic archived. No new replies allowed.