System.out.println("Hello World!"); SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss");//设置时间格式 Date currentTime = new Date();//获取当前时间 String date=format.format(currentTime);//对当前时间进行格式化 currentTime=format.parse(dat
1. 短时间,形如 (13:04:06) function isTime(str) { var a = str.match(/^(\d{1,2})(:)?(\d{1,2})\2(\d{1,2})$/); if (a == null) {alert('输入的参数不是时间格式'); return false;} if (a[1]>24 || a[3]>60 || a[4]>60) { alert("时间格式不对"); return false } return true;