关于时间的转换

//把秒转换成分钟 
       /// <summary>
        /// 把秒转换成分钟
        /// </summary>
        /// <returns></returns>
        public static int SecondToMinute(int Second)
        {
            //   / 换成 * 号就是 把分钟换成秒
            decimal mm = (decimal)((decimal)Second / (decimal)60);   
            Console.WriteLine(mm);
            return Convert.ToInt32(Math.Ceiling(mm));
        }

 

        /// <summary>
        /// 返回某年某月最后一天
        /// </summary>
        /// <param name="year">年份</param>
        /// <param name="month">月份</param>
        /// <returns></returns>
        public static int GetMonthLastDate(int year, int month)
        {
            DateTime lastDay = new DateTime(year, month, new System.Globalization.GregorianCalendar().GetDaysInMonth(year, month));
            int Day = lastDay.Day;
            return Day;
        }

 

posted @ 2014-05-10 15:38  团长丶Joe  阅读(116)  评论(0编辑  收藏  举报