help about date time
-
i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram
-
i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram
-
i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram
vikram Verma wrote:
i need to store time beyond 1st jan 2038 in that object
As the other guy said use COleDateTime, but do not use COleDateTime::GetCurrentTime... From MSDN... COleDateTime::GetCurrentTime. The current implementation calls the C run-time function time, which returns a time_t. This limitation isn't currently documented—it presumably took Chris's digging through the Microsoft Foundation Classes (MFC) source code to find it. (As Dr. GUI says, "Use the source, Luke!") Good job. Don't use this function if you need to be year 2038 compliant. Note also that COleDateTime has a constructor and assignment operator that take a time_t—don't use those either. A suitable replacement will be GetLocalTime.
Nibu thomas A Developer Programming tips[^] My site[^]
-
i am new to mfc. i my application i am usind CTime object. i need to store time beyond 1st jan 2038 in that object. I guess CTime object wont be able to store values beyond 1st jan 2038 , so what other options i have ,,, say i want to store year value as 2150. pls help Vikram