validator.js中添加验证 beforeCurrentTime : {// 时间不能大于当前时间 validator : function(value) { var myDate = new Date(); var now = myDate.valueOf(); var time = new Date(value).valueOf(); if(now>time){ return true; }else{ return false; } },
现在用id来代替时间这样好测试 看一下测试表数据 执行按需求规则排序的sql SELECT * FROM number_generator ORDER BY id < 16 , IF(id < 16,0,id) , id DESC id 小于16的至尾 ,并按降序排序,id大于16的升序排序,这种sql也支持分页
CREATE OR REPLACE FUNCTION DIFFHOURTIME_WITHOUTHOLIDAY_FUN ( STARTTIME ), ENDTIME ) ) RETURNS DOUBLE LANGUAGE SQL NOT DETERMINISTIC EXTERNAL ACTION READS SQL DATA INHERIT SPECIAL REGISTERS -------------------------------------------------------------
转自:http://www.cnblogs.com/zxjyuan/archive/2010/09/07/1820708.html js日期比较(yyyy-mm-dd) function duibi(a, b) { var arr = a.split("-"); var starttime = new Date(arr[0], arr[1], arr[2]); var starttimes = starttime.getTime(); var arrs = b.spl
1.js获取系统时间格式为YYYY-MM-DD HH:MM:SS 1 function curDateTime(){ 2 var d = new Date(); 3 var year = d.getYear(); 4 var month = d.getMonth()+1; 5 var date = d.getDate(); 6 var day = d.getDay(); 7 var hours = d.getHours(); 8 var minutes = d.getMinutes(); 9 v