int CMSTime::GetSecond() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? ptm->tm_sec : -1 ; }
int CMSTime::GetDayOfWeek() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? ptm->tm_wday + 1 : 0 ; }
int CMSTime::GetHour() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? ptm->tm_hour : -1 ; }
int CMSTime::GetMinute() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? ptm->tm_min : -1 ; }
int CMSTime::GetMonth() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? ptm->tm_mon + 1 : 0; }
int CMSTime::GetDay() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? ptm->tm_mday : 0 ; }
int CMSTime::GetYear() const { struct tm ttm; struct tm * ptm; ptm = GetLocalTm(&ttm); return ptm ? (ptm->tm_year) + 1900 : 0 ; }
BOOL CTime::GetAsSystemTime(SYSTEMTIME& timeDest) const { struct tm* ptm = GetLocalTm(NULL); if (ptm == NULL) return FALSE; timeDest.wYear = (WORD) (1900 + ptm->tm_year); timeDest.wMonth = (WORD) (1 + ptm->tm_mon); timeDest.wDayOfWeek = (WORD) ptm->tm_wday; timeDest.wDay = (WORD) ptm->tm_mday; timeDest.wHour = (WORD) ptm->tm_hour; timeDest.wMinute = (WORD) ptm->tm_min; timeDest.wSecond = (WORD) ptm->tm_sec; timeDest.wMilliseconds = 0; return TRUE; }
bool MightyTime::GetAsSystemTime(SYSTEMTIME& timeDest) const throw() { struct tm* ptm = GetLocalTm(NULL); if (!ptm) return false; timeDest.wYear = (WORD) (1900 + ptm->tm_year); timeDest.wMonth = (WORD) (1 + ptm->tm_mon); timeDest.wDayOfWeek = (WORD) ptm->tm_wday; timeDest.wDay = (WORD) ptm->tm_mday; timeDest.wHour = (WORD) ptm->tm_hour; timeDest.wMinute = (WORD) ptm->tm_min; timeDest.wSecond = (WORD) ptm->tm_sec; timeDest.wMilliseconds = 0; return true; }
int MightyTime::GetDayOfWeek() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? ptm->tm_wday + 1 : 0 ; }
int MightyTime::GetSecond() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? ptm->tm_sec : -1 ; }
int MightyTime::GetMinute() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? ptm->tm_min : -1 ; }
int MightyTime::GetHour() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? ptm->tm_hour : -1 ; }
int MightyTime::GetDay() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? ptm->tm_mday : 0 ; }
int MightyTime::GetMonth() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? ptm->tm_mon + 1 : 0; }
int MightyTime::GetYear() const { struct tm * ptm; ptm = GetLocalTm(); return ptm ? (ptm->tm_year) + 1900 : 0 ; }