格式化时间NULL yyyy-MM-dd HH:mm - FormatFullDateTimeNull
2017-02-26 20:42:00 访问(1393) 赞(0) 踩(0)
/// <summary>
/// 格式化时间NULL yyyy-MM-dd HH:mm - FormatFullDateTimeNull
/// </summary>
/// <param name="theValue"></param>
/// <returns></returns>
public string FormatFullDateTimeNull(DateTime? theValue)
{
if (theValue == null)
return "";
return theValue.Value.ToString("yyyy-MM-dd HH:mm");
}
/// <summary>
/// 格式化时间 yyyy-MM-dd HH:mm - FormatFullDateTimeNull
/// </summary>
/// <param name="theValue"></param>
/// <param name="nullToDefault"></param>
/// <returns></returns>
public string FormatFullDateTimeNull(DateTime? theValue, string nullToDefault)
{
if (theValue == null)
return nullToDefault;
return theValue.Value.ToString("yyyy-MM-dd HH:mm");
}
标签:
格式化时间NULL yyyy-MM-dd HH:mm - FormatFullDateTimeNull 


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