android得到系统时间如何判断是白天还是晚上
ContentResolver cv = getBaseContext().getContentResolver(); String strTimeFormat = android.provider.Settings.System.getString(cv, android.provider.Settings.System.TIME_12_24); if(strTimeFormat!=null && strTimeFormat.equals("24")) { Log.i("Debug","24小时制"); } else { String amPmValues; Calendar c = Calendar.getInstance(); if(c.get(Calendar.AM_PM) == 0) { amPmValues = "AM"; } else { amPmValues = "PM"; } Log.i("Debug","12小时制现在是:" + amPmValues); }