private static void myHandler() throws ParseException {
String dtime1 = "23/Apr/2019:04:08:00 +0800";
SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MMM/yyyy:hh:mm:ss Z", Locale.US);
Date date = sdf1.parse(dtime1);
System.out.println(date.getHours());
}
原文地址:https://www.cnblogs.com/xiashiwendao/p/10777553.html
时间: 2024-10-25 23:20:58