DateTime格式化输出

2014-12-31 15:24:54  访问(1762) 赞(0) 踩(0)


        /// <summary>
        /// DateTime格式化输出
        /// </summary>
        /// <param name="theValue"></param>
        /// <param name="strFormat"></param>
        /// <returns></returns>
        public string DateTimeFormatDefault
            (
                DateTime theValue, 
                string strFormat
            )
        {
            if (strFormat == null || strFormat.Length == 0)
            {
                if (DateTimeFormatShowSecond)
                    return theValue.ToString("yyyy-MM-dd HH:mm:ss");
                else
                    return theValue.ToString("yyyy-MM-dd HH:mm");
            }
            else
                return theValue.ToString(strFormat);
        }


标签:DateTime格式化输出 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)