#include <cctime.h>
Inheritance diagram for CCTime:
Public Member Functions | |
CCTime () | |
Constructor for CCTime object. We get the current local time ready for use. | |
virtual void | GetCurrentTime () |
Updates this CCTime object with the date and time now. | |
virtual INT32 | GetMonth () |
Returns the month based on local time, in the range 1 through 12, (1=January). |
Definition at line 180 of file cctime.h.
|
Constructor for CCTime object. We get the current local time ready for use.
Definition at line 439 of file cctime.cpp. 00440 { 00441 // Force the time to be up-to-the-second 00442 GetCurrentTime(); 00443 }
|
|
Updates this CCTime object with the date and time now.
Reimplemented from CCTimeBase. Definition at line 455 of file cctime.cpp. 00456 { 00457 struct tm *newtime; 00458 time_t long_time; 00459 00460 // Set time zone from TZ environment variable. If TZ is not set, 00461 // operating system default is used, otherwise PST8PDT is used 00462 // (Pacific standard time, daylight savings). 00463 // _tzset(); 00464 00465 time( &long_time ); // Get time as long integer. 00466 newtime = localtime( &long_time ); // Convert to local time. 00467 00468 cctime *p_time = GetTimeStruct(); 00469 00470 p_time->tm_sec = newtime->tm_sec; 00471 p_time->tm_min = newtime->tm_min; 00472 p_time->tm_hour = newtime->tm_hour; 00473 p_time->tm_mday = newtime->tm_mday; 00474 p_time->tm_mon = newtime->tm_mon; 00475 p_time->tm_year = newtime->tm_year; 00476 p_time->tm_wday = newtime->tm_wday; 00477 p_time->tm_yday = newtime->tm_yday; 00478 p_time->tm_isdst= newtime->tm_isdst; 00479 }
|
|
Returns the month based on local time, in the range 1 through 12, (1=January).
Reimplemented from CCTimeBase. Definition at line 491 of file cctime.cpp. 00492 { 00493 return CCTimeBase::GetMonth() + 1; 00494 }
|