如何分别获得当前时间的年,月,起,小时,分钟,这些数据.望前辈们指教

解决方案 »

  1.   

    public static String getDateTimeofToday()
    {
    return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
    }
      

  2.   

    CTime time = CTime::GetCurrentTime();
    time.GetYear(); 
    ...;
      

  3.   

    ets2008()请问这引用的是哪个JAVA包呀?
      

  4.   

    java.util.Date
    java.text.SimpleDateFormat 这两个类
      

  5.   

    import java.util.dateDate dt=new Date();
    dt.getYear()
    ...
      

  6.   

    我有用拉meteorlg(lance) 的方法居然出来107年0月3日16小时14分,这是怎么搞的?
      

  7.   

    Calendar cd = Calendar.getInstance();
    cd.setTime(new Date());
    int year = cd.get(Calendar.YEAR);
    int month= cd.get(Calendar.MONTH);
    其他的类似。
    注:Date,Calendar类都在java.util里
      

  8.   

    BS做广告的
    严重BS做不正当广告的
      

  9.   

    如何读取系统当前日期??用什么函数??http://www.java99.com/?m=ViewFaq&id=83
      

  10.   

    用lzg0409() 的方法还是得不到月份
      

  11.   

    我有用拉meteorlg(lance) 的方法居然出来107年0月3日16小时14分,这是怎么搞的?你要仔细看每个函数的帮助,getYear是从1900年开始的年份,要加上1900才对
    getMonth是从0到11,你要加上1就对了