簽到時間計算
發布時間:2018-02-03 16:59
作者:獨孤劍
閱讀:1253
//// 按月簽到
//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);
微信打賞, 微信掃一掃
支付寶打賞, 支付寶掃一掃
如果文章對您有幫助,歡迎給作者打賞