通过年月日怎么得到该日是一年中的第几个星期???

解决方案 »

  1.   

    CTime t2=CTime::GetCurrentTime();

    CString cs;
    cs=t2.Format("%W");TRACE("%s",(LPCTSTR)cs);
      

  2.   

    CTime t2(/*year*/2006,/*month*/10,/*day*/13,/*hour*/12,/*minute*/16,/*second*/00);
    CString cs;
    cs=t2.Format("%W");TRACE("%s",(LPCTSTR)cs);
      

  3.   

    t2.Format("%W");有%W  这个吗?
      

  4.   

    %WWeek of year as decimal number, with Monday as first day of week (00 – 53)
      

  5.   

    CString csTime;
    csTime.Format("%4d-%02d-%02d 10:10:10",年,月,日);
    COleDateTime dt;
    dt.ParseDateTime(csTime);csTime = dt.Format("%W");
    //有的,%W是表示以礼拜一为第一天的的第几周
    //%V,是以礼拜天为第一天的第几周,注意区别啊具体可以参考,COleDateTime::Format操作