Date date=new Date(); String[] timeStr = new SimpleDateFormat("HH:mm:ss").format(date).split(":"); String hour = timeStr[0]; String minute = timeStr[1]; String second = timeStr[2]; System.out.println("现在是:"+hour+"时"+minute+"分"+second+"秒");