Exemplo n.º 1
0
int CMSTime::GetSecond() const
{ 
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? ptm->tm_sec : -1 ;
}
Exemplo n.º 2
0
int CMSTime::GetDayOfWeek() const
{ 
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? ptm->tm_wday + 1 : 0 ;
}
Exemplo n.º 3
0
int CMSTime::GetHour() const
{
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? ptm->tm_hour : -1 ; 
}
Exemplo n.º 4
0
int CMSTime::GetMinute() const
{
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? ptm->tm_min : -1 ; 
}
Exemplo n.º 5
0
int CMSTime::GetMonth() const
{ 
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? ptm->tm_mon + 1 : 0;
}
Exemplo n.º 6
0
int CMSTime::GetDay() const
{
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? ptm->tm_mday : 0 ; 
}
Exemplo n.º 7
0
int CMSTime::GetYear() const
{ 
	struct tm ttm;
	struct tm * ptm;

	ptm = GetLocalTm(&ttm);
	return ptm ? (ptm->tm_year) + 1900 : 0 ; 
}
Exemplo n.º 8
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;
}
Exemplo n.º 10
0
int MightyTime::GetDayOfWeek() const
{ 
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? ptm->tm_wday + 1 : 0 ;
}
Exemplo n.º 11
0
int MightyTime::GetSecond() const
{ 
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? ptm->tm_sec : -1 ;
}
Exemplo n.º 12
0
int MightyTime::GetMinute() const
{ 
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? ptm->tm_min : -1 ; 
}
Exemplo n.º 13
0
int MightyTime::GetHour() const
{
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? ptm->tm_hour : -1 ; 
}
Exemplo n.º 14
0
int MightyTime::GetDay() const
{
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? ptm->tm_mday : 0 ; 
}
Exemplo n.º 15
0
int MightyTime::GetMonth() const
{ 
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? ptm->tm_mon + 1 : 0;
}
Exemplo n.º 16
0
int MightyTime::GetYear() const
{ 
	struct tm * ptm;
	ptm = GetLocalTm();
	return ptm ? (ptm->tm_year) + 1900 : 0 ; 
}