|
-
Feb 8th, 2002, 11:41 AM
#1
Thread Starter
Hyperactive Member
getting current year
is there some way to do this with ctime?
I have included ctime, and I created a ctime variable for storing the current time, CTime theTime;
but I get an error "CTime undeclared identifier".
Also, is there anyway to seperate the year from the returned value?
Thank you!!
-
Feb 8th, 2002, 03:31 PM
#2
Where are you trying to use this??? Are you creating an MFC app? Or using MFC? Becuase CTime is a MFC class.
-
Feb 8th, 2002, 03:36 PM
#3
If you don't wanna use MFC, there is always this option...
Code:
struct tm * tmTime = NULL;
time_t tTimeInt = 0;
time( &tTimeInt );
tmTime = localtime( &tTimeInt );
tmTime->tm_year; // This is the current year
// minus 1900.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|