Pelles C forum

C language => Beginner questions => Topic started by: viperjd on September 26, 2009, 04:50:04 PM

Title: how to get year in c ?
Post by: viperjd on September 26, 2009, 04:50:04 PM
I need to know how to get the current year from the computer and use it in an equation.
(sample: Car_age = make_year - current_year). I wanna make it so the pro gram uses the computer date if possiable so that it does not have to be updated every year.
Title: Re: how to get year in c ?
Post by: CLR on September 26, 2009, 08:43:15 PM

http://www.cplusplus.com/reference/clibrary/ctime/localtime/

http://www.cplusplus.com/reference/clibrary/ctime/tm/