java中获取各种日期的方法(年,月,日,时,分,秒...)
创建获取对象
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR) 年
c.get(Calendar.MONTH) + 1 月(0开始所以加一)
c.get(Calendar.DAY_OF_MONTH)); 日
c.get(Calendar.HOUR_OF_DAY));24时制小时
c.get(Calendar.HOUR));12时制
c.get(Calendar.MINUTE));分
c.get(Calendar.SECOND));秒
c.get(Calendar.DAY_OF_YEAR) 今天是一年中的第几天
Toast.makeText(this, “内容”, Toast.LENGTH_SHORT).show(); 显示