Site Meter & 線上人數

tracker

部落格觀察


我的噗浪

Google Latitude

微軟認證



聯絡我 - MSN & Skype & Email



最新回應

C# 計算差異天數

2008/3/18 19:39| 閱讀數 : 1165 | 我要推薦 | One Comment | 文章分類: .NetFramework C# 訂閱

  1. string startDate = "2007/07/01";
  2. string endDate = "2007/07/07";
  3. DateTime dtStart = DateTime.ParseExact (startDate, "yyyy/MM/dd", null );
  4. DateTime dtEnd = DateTime.ParseExact (endDate, "yyyy/MM/dd", null );
  5. // 計算差異天數
  6. TimeSpan tsDay = dtEnd - dtStart;
  7. int dayCount = ( int ) tsDay.TotalDays;

DotBlogs Tags: .NetFramework C# chhuang


關連文章

回應

  • 好學生 2009/6/22 上午 10:56 回覆

    # 感謝妳

    我們的期末考 都虧了你的幫忙~
    鞠躬...... !!
標題 *
名稱 *
Email (將不會被顯示)
Url
回應
登入後使用進階評論
Please add 7 and 8 and type the answer here: