日期:2014-05-17 浏览次数:20747 次
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script src="js/DatePicker/WdatePicker.js" language="javascript"></script> <script type="text/javascript"> function getNowTime(){ var dsq = null; var now= new Date(); var year=now.getYear(); var month=now.getMonth()+1; if(month<10){ month = "0"+month; } var day=now.getDate(); if(day<10){ day = "0"+day; } var hour=now.getHours(); if(hour<10){ hour = "0"+hour; } var minute=now.getMinutes(); if(minute<10){ minute = "0"+minute; } var second=now.getSeconds(); if(second<10){ second = "0"+second; } var nowdate=year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second; var txtime = document.getElementById("now").value; if(nowdate == txtime){ alert("闹铃:"+nowdate); clearTimeout(dsq); } dsq = setTimeout("getNowTime()",1000); } </script> </head> <body> 请选择提醒时间:<input type="text" name="now" size="20" style="margin-right:5px;" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" > <input type="button" onclick="getNowTime()" value="定时"/> </body> </html>