hello,
I would like to know how to read the year format in tm structure. I obtain 106 as 2006 year. Could some one tell me what is the rule and method to extract year format in tm structure of ISO C.
Thank you.
hello,
I would like to know how to read the year format in tm structure. I obtain 106 as 2006 year. Could some one tell me what is the rule and method to extract year format in tm structure of ISO C.
Thank you.
Well, tm_year indicates years from 1900
1900+106 = 2006
Ok I understand the rule.
Thank you.
If you look at the man pages for any given C function, it'll usually tell you everything you ever need to know about the function: http://unixhelp.ed.ac.uk/CGI/man-cgi?localtime+3
Broken-down time is stored in the structure tm which is defined in
<time.h> as follows:
struct tm {
int tm_sec; /* seconds */
int tm_min; /* minutes */
int tm_hour; /* hours */
int tm_mday; /* day of the month */
int tm_mon; /* month */
int tm_year; /* year */
int tm_wday; /* day of the week */
int tm_yday; /* day in the year */
int tm_isdst; /* daylight saving time */
};
...
tm_year
The number of years since 1900.
If you understand what you're doing, you're not learning anything.