Exemplo n.º 1
0
 public static string GetLastMonthTime()
 {
     System.DateTime now    = System.DateTime.Now;
     System.DateTime bgDate = System.Convert.ToDateTime(now.AddMonths(-1).ToString("yyyy-MM-01"));
     System.DateTime enDate = System.Convert.ToDateTime(now.ToString("yyyy-MM-01"));
     return(Fetch.GetTimeByDate(bgDate, enDate));
 }
Exemplo n.º 2
0
 public static string GetLastWeekTime()
 {
     System.DateTime now    = System.DateTime.Now;
     System.DateTime bgDate = now.AddDays((double)(-7 - System.Convert.ToInt32(now.DayOfWeek.ToString("d"))));
     System.DateTime enDate = bgDate.AddDays(6.0);
     return(Fetch.GetTimeByDate(bgDate, enDate));
 }
Exemplo n.º 3
0
 public static string GetYearTime()
 {
     System.DateTime now    = System.DateTime.Now;
     System.DateTime bgDate = now.AddDays((double)(1 - now.DayOfYear));
     System.DateTime enDate = bgDate.AddYears(1).AddDays(-1.0);
     return(Fetch.GetTimeByDate(bgDate, enDate));
 }
Exemplo n.º 4
0
 public static string GetYesterdayTime()
 {
     System.DateTime dateTime = System.DateTime.Now.AddDays(-1.0);
     return(Fetch.GetTimeByDate(dateTime, dateTime));
 }
Exemplo n.º 5
0
 public static string GetTodayTime()
 {
     System.DateTime now = System.DateTime.Now;
     return(Fetch.GetTimeByDate(now, now));
 }