今天接触了VC下的时间,
COleDateTime
COleDateTimeSpan
CTime
CTimeSpan
tm
time_t
::mktime()
1.获得当前时间:
COleDateTime::GetCurrentTime()
CTime::GetCurrentTime()
2.把long转成时间:
long lTicks = XXXXXXX;
time_t srcTime = (time_t) lTicks;
CTime time(srcTime);
3.把时间转成long:
CTime time;
tm tmTime = time.Get???Tm();
(long) ::mktime(tmTime);