DateTime?转字符串
2015-10-29 08:41:07 访问(1462) 赞(0) 踩(0)
/// <summary>
/// DateTime?转字符串
/// </summary>
/// <param name="theValue"></param>
/// <returns></returns>
public string DateTimeNullToString(DateTime? theValue)
{
if (theValue == null)
return "";
return theValue.Value.ToString("yyyy-MM-dd HH:mm:ss");
}
/// <summary>
/// DateTime?转字符串
/// </summary>
/// <param name="theValue"></param>
/// <returns></returns>
public string DateTimeNullToDateString(DateTime? theValue)
{
if (theValue == null)
return "";
return theValue.Value.ToString("yyyy-MM-dd");
}
标签:
DateTime?转字符串 


上一条:
下一条:
相关评论
发表评论