常量定义问题、获得两个时间之间的周数等问题

一、常量定义问题
public static string IsScorePubSMSedSchoolID="*****"; 
public static string IsScorePubSMSedCity="***";
二、获得两个时间之间的周数
  public int DateDiffWeek(DateTime StartTime,DateTime EndTime){
   System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("en-US");
   System.Globalization.Calendar myCal = myCI.Calendar;

   System.Globalization.CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
   DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
   int SWeeks=myCal.GetWeekOfYear(StartTime,myCWR,myFirstDOW);
   int EWeeks=myCal.GetWeekOfYear(EndTime,myCWR,myFirstDOW);
   return EWeeks-SWeeks;
  }

posted @ 2005-08-31 00:55  浪剑  阅读(438)  评论(0编辑  收藏  举报