You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "ValStrDate.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CValStrDate::CValStrDate(void)
|
|
|
|
|
{
|
|
|
|
|
m_DateType = _DATE_YEAR_FOUR;
|
|
|
|
|
m_ValStrType = _STR_DATE;
|
|
|
|
|
}
|
|
|
|
|
CValStrDate::~CValStrDate(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CString CValStrDate::GetTypeStr()
|
|
|
|
|
{
|
|
|
|
|
return "Date";
|
|
|
|
|
}
|
|
|
|
|
CString CValStrDate::GetStr()
|
|
|
|
|
{
|
|
|
|
|
//<2F><>ȡ<EFBFBD><C8A1>ǰϵͳʱ<CDB3><CAB1>
|
|
|
|
|
CTime tm; tm=CTime::GetCurrentTime();
|
|
|
|
|
|
|
|
|
|
CString str;
|
|
|
|
|
switch(m_DateType)
|
|
|
|
|
{
|
|
|
|
|
case _DATE_YEAR_FOUR:
|
|
|
|
|
str = tm.Format("20%y");
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_YEAR_TWO:
|
|
|
|
|
str = tm.Format("%y");
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_MONTH:
|
|
|
|
|
str = tm.Format("%m");
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_DAY:
|
|
|
|
|
str = tm.Format("%d");
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_DAY_IN_YEAR:
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_WEEK:
|
|
|
|
|
str = tm.Format("%w");
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_WEEK_IN_YEAR:
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD>߲<EFBFBD>0
|
|
|
|
|
AddLeftZreo(str);
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
CString CValStrDate::GetDateTypeStr()
|
|
|
|
|
{
|
|
|
|
|
CString str;
|
|
|
|
|
switch(m_DateType)
|
|
|
|
|
{
|
|
|
|
|
case _DATE_YEAR_FOUR:
|
|
|
|
|
case _DATE_YEAR_TWO:
|
|
|
|
|
str = "<EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_MONTH:
|
|
|
|
|
str = "<EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_DAY:
|
|
|
|
|
str = "<EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_DAY_IN_YEAR:
|
|
|
|
|
str = "<EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_WEEK:
|
|
|
|
|
str = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
case _DATE_WEEK_IN_YEAR:
|
|
|
|
|
str = "<EFBFBD><EFBFBD>";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return str;
|
|
|
|
|
}
|