在BLL层 怎么判断日期格式为2009-10
我的代码,要怎么改才能把格式控制为2009-10 不要2009-10-11这样的呢
这个是我在BLL层中写的代码
public bool IsDateYuefen(string strValue)
{
bool bolReturn;
DateTime dteReturn;
if (strValue == null)
{
bolReturn = false;
}
try
{
dteReturn = Convert.ToDateTime(strValue);
bolReturn = true;
}
catch
{
bolReturn = false;
}
return bolReturn;
}