签到时间计算

            //// 按月签到
            //string signtime = "12:00";
            //string signdate = "23";
            //DateTime start = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + signdate + " " + signtime).AddHours(-1);
            //DateTime end = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + signdate + " " + signtime).AddHours(+4);

            //// 按周签到
            //string signtime = "12:00";
            //string signweek = "5";// 每周星期几
            //if ((int)DateTime.Now.DayOfWeek==(int.Parse(signweek)))
            //{
            //    DateTime start = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString() + " " + signtime).AddHours(-1);
            //    DateTime end = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString() + " " + signtime).AddHours(+4);
            //}

            // 按天签到
            string signtime = "12:00";
            DateTime start = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString() + " " + signtime).AddHours(-1);
            DateTime end = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Day.ToString() + " " + signtime).AddHours(+4);

热门推荐