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

    xiaoxiao2021-03-25  213

    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);
    转载请注明原文地址: https://ju.6miu.com/read-4876.html

    最新回复(0)