是否时间类型 - IsDateTimeType

2017-02-19 13:34:23  访问(1367) 赞(0) 踩(0)


        /// <summary>
        /// typeof(DateTime?)
        /// </summary>
        public readonly static Type typeDateTimeNull = typeof(DateTime?);


        /// <summary>
        /// typeof(DateTime)
        /// </summary>
        public readonly static Type typeDateTime = typeof(DateTime);


        /// <summary>
        /// 是否时间类型
        /// </summary>
        /// <param name="theValue"></param>
        /// <returns></returns>
        public bool IsDateTimeType(Type theValue)
        {
            if (theValue == typeDateTime
                || theValue == typeDateTimeNull)
                return true;

            return false;
        }


标签:是否时间类型 - IsDateTimeType 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)