Android 获取当前的时间。年月日,时分秒

SimpleDateFormat alldate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//获取日期时间
SimpleDateFormat year = new SimpleDateFormat("yyyy");//获取年份
        SimpleDateFormat month = new SimpleDateFormat("MM");//获取月份
        SimpleDateFormat minute = new SimpleDateFormat("mm");//获取分钟
String years = year.format(new Date());
String MM = month.format(new Date());
String minutes = minute.format(new Date());
Log.i("lgq","......"+years+MM+minutes);

猜你喜欢

转载自blog.csdn.net/meixi_android/article/details/82491015
今日推荐