分钟数转换成倒计时,格式 _天_时_分

 #region 分钟数转换成倒计时,格式 _天_时_分 + string MinutesToCountdown(int Minutes)
        /// <summary>
        /// 将分钟数转换成倒计时 格式:_天_时_分
        /// </summary>
        /// <param name="Minutes">分钟数</param>
        /// <returns></returns>
        public static string MinutesToCountdown(int Minutes)
        {
            if (Minutes == 0) { return "0天0时0分"; }
            int day = 24 * 60;
            int hour = 60;
            int remainder = 0;
            int integer = 0;

            StringBuilder sb = new StringBuilder();
            integer = Minutes / day;
            remainder = Minutes % day;
            sb.Append(integer + "");

            integer = remainder / hour;
            remainder = remainder % hour;
            sb.Append(integer + "" + remainder + "");

            return sb.ToString();
        }

        #endregion

 

posted @ 2015-01-05 09:54  JasonGu0  阅读(417)  评论(0编辑  收藏  举报