int t = 3435973836;
想把t -> 2006/05/24 02:44
我用CTime结果转换的结果不正确。
请问有什么方法吗?

解决方案 »

  1.   

    long tmp = 1154121361796l;
    Date a = new Date();
    a.setTime(tmp);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm"); 
    System.out.println(sdf.format(a));
      

  2.   

    long t = 1148409840;
    CTime a = CTime(t);
    a.Format("%Y/%m/%d %M:%S");
      

  3.   

    COleDateTime ttimes(3435973836.0); CString strDate; strDate.Format(_T("%d\/%d\/%d %d:%d"),ttimes.GetYear(),ttimes.GetMonth(),ttimes.GetDay(),ttimes.GetHour(),ttimes.GetMinute());
      

  4.   

    这些我都试过了,不行啊,值不正确
    比如说
    CTime tm(221);
    CString strDate;
    strDate = tm.Format("%H:%M:%S");
    结果得到的数据时 09:03:41  前面多了一个09
      

  5.   

    你的计算机设置的时区是9时区?
    用FormatGmt