关于时间的转换

时间:2014-05-12 09:33:41   收藏:0   阅读:198
bubuko.com,布布扣
//把秒转换成分钟 
       /// <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));
        }
bubuko.com,布布扣

 

bubuko.com,布布扣
        /// <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;
        }
bubuko.com,布布扣

 

关于时间的转换,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!