遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

java时间

//获取当前时间是一个星期的第几天,星期日是第一天 星期一是第二天,以此类推
int thedayofweek=theDay.get(Calendar.DAY_OF_WEEK);

------------------------------

  Calendar calendar=Calendar.getInstance();
  Log.d("T", "HOUR:" + calendar.get(Calendar.HOUR));
  Log.d("T", "HOUR_OF_DAY:" + calendar.get(Calendar.HOUR_OF_DAY));
  Log.d("T", "Minute:" +calendar.get(Calendar.MINUTE));
  Log.d("T", "DAY_OF_MONTH:" + calendar.get(Calendar.DAY_OF_MONTH));
  Log.d("T", "DAY_OF_WEEK:" + calendar.get(Calendar.DAY_OF_WEEK));
  Log.d("T", "MONTH:" +calendar.get(Calendar.MONTH));
  Log.d("T", "MILLISECOND:" +calendar.get(Calendar.MILLISECOND));
  

posted on 2013-10-08 09:45  遗忘海岸  阅读(159)  评论(0编辑  收藏  举报