获取系统时间进制转换时间

来源:互联网 发布:js选择时间段 编辑:程序博客网 时间:2024/06/05 08:47

LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale);
boolean is24 = android.text.format.DateFormat.is24HourFormat(context);

        String timeformat = is24 ? d.timeFormat_Hms : d.timeFormat_hms;        String dataformat = d.getDateFormat(java.text.DateFormat.DEFAULT) +" "+ timeformat;        dayFormat = new SimpleDateFormat(dataformat);        Date thenDate = new Date(date);            return dayFormat.format(thenDate);
0 0