GetDateTimeYesterday.ashx 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <%@ WebHandler Language="C#" Class="Get_HG5010_DateTime" %>
  2. using System;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. using System.Collections.Generic;
  6. using System.Configuration;
  7. using System.Data;
  8. using Curtain.DataAccess;
  9. using Curtain.Log;
  10. using DK.XuWei.WebMes;
  11. public class Get_HG5010_DateTime : IHttpHandler,IRequiresSessionState
  12. {
  13. public void ProcessRequest(HttpContext context)
  14. {
  15. //string time = DateTime.Now.ToString("yyyy年MM月dd日 HH:mm ");
  16. string time = DateTime.Now.AddDays(-1).ToString("yyyy年MM月dd日 ");
  17. string week = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(-1).DayOfWeek);
  18. Dictionary<string, string> d = new Dictionary<string, string>();
  19. d["时间"] = time + week;
  20. context.Response.Write(new JsonResult() { success = true, message = "操作成功!", rows = d, total = 0 }.ToJson());
  21. }
  22. public bool IsReusable
  23. {
  24. get
  25. {
  26. return false;
  27. }
  28. }
  29. }