时间格式转换:
Date nowTime=new Date();
SimpleDateFormat time=new SimpleDateFormat("yyyy MM dd HH mm ss");String dataStr = time.format(nowTime);
表单防重复提交处理:
private static long lastClickTime;
/**
* 防止多次点击事件处理
*/
public static boolean isFastDoubleClick() {
long time = System.currentTimeMillis();
long timeD = time - lastClickTime;
if (0 < timeD && timeD < 2000) {
return true;
}
lastClickTime = time;
return false;
}