tm structure filled wrong by the system?

Hey,

i have a problem with the following code... more precise with the tm structure.
when i run this code, it seems that the tm structures members tm_mon and tm_year overlapp or something like that...

today is yanuary the 13 2010...

what i get is month = 0 and year = 110 instead of 10...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
	time_t CurrentTime = time(NULL);
	tm *Tm = localtime(&CurrentTime);

	string Zeitpunkt;
	stringstream ss;

	ss << Tm->tm_mday;
	Zeitpunkt += ss.str();
	Zeitpunkt += ":";
	ss.str("");
	ss << Tm->tm_mon;
	Zeitpunkt += ss.str();
	ss.str("");
	Zeitpunkt += ":";
	ss << Tm->tm_year;
	Zeitpunkt += ss.str();
	ss.str("");
	Zeitpunkt += "-";
	ss << Tm->tm_hour;
	Zeitpunkt += ss.str();
	ss.str("");
	Zeitpunkt += ":";
	ss << Tm->tm_min;
	Zeitpunkt += ss.str();


anyone got any clue where it comes from?
Last edited on
Month goes from 0-11 I believe, and the year is the number of years since 1990, not the last two digits of the year.
oh ok... thank you and sorry for this...

have to read the libs more carefully^^...
Topic archived. No new replies allowed.