android 获取系统时间

long time=System.currentTimeMillis(); 
final Calendar mCalendar=Calendar.getInstance();  
mCalendar.setTimeInMillis(time);  
取得小时:mHour=mCalendar.get(Calendar.HOUR);  
取得分钟:mMinuts=mCalendar.get(Calendar.MINUTE);  
Time t=new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone资料  
t.setToNow(); // 取得系统时间。  
int year = t.year;  
int month = t.month;  
int date = t.monthDay;  
int hour = t.hour;    // 0-23  
DateFormat df = new SimpleDateFormat("HH:mm:ss");  
df.format(new Date());  
原文地址:https://www.cnblogs.com/mbp-study/p/6553954.html