Exemple #1
0
        /// <summary>
        /// 长日期 2000-01-01 24:59:59
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static string LongDate(string date)
        {
            DateTime?dat = TypeParse.StrToDateTime(date, DateTime.Now);

            if (!dat.HasValue)
            {
                dat = DateTime.Now;
            }
            return(LongDate(dat.Value));
        }
Exemple #2
0
        /// <summary>
        /// 只取年和月 2000-01
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static string DateFormatYearMonth(string date)
        {
            DateTime?dat = TypeParse.StrToDateTime(date, DateTime.Now);

            if (!dat.HasValue)
            {
                dat = DateTime.Now;
            }
            return(DateFormatYearMonth(dat.Value));
        }
Exemple #3
0
 /// <summary>
 /// 查询的结束时间
 /// </summary>
 /// <param name="date"></param>
 public static string EndDateForQuery(string date)
 {
     return(EndDateForQuery(TypeParse.StrToDateTime(date)));
 }