jQuery 誰記得那麼多用法呀,當然要有一本參考手冊呀,
不管新手、老手都需要這玩意兒,快加入書籤吧
不管新手、老手都需要這玩意兒,快加入書籤吧
[……]
[……]
})
//相對位置
})[……]
2.
排序點分式IP3.
將某列中特定值排在最前4.
將某列內容按照使用者自訂的順序排序5.
對枚舉類型排序6.
按csv類型的字串的某字串排序[……]
/*
https://vector.cool
*/
$time = strtotime('2015-03-04 12:03:25');
//output : 1425441805
一、慢慢算
/*
https://vector.cool
*/
date_default_timezone_set("Asia/Taipei");
$next_Month = 30*24*60*60;//30天*24小時*60分*60秒
echo date('Y-m-d',strtotime('2015-03-04 12:03:25')+$next_Month);二、使用 mktime()
/*
https://vector.cool
*/
date_default_timezone_set("Asia/Taipei");
$date=date("Y-m-d",mktime(hr,min,sec,mon,day,year))
//例如:今天再加5天
date("y-m-d",mktime(0,0,0,date("m"),(date("d")+5),date("y")))Reference:http://php.net/manual/zh/function.mktime.php
三、使用 strtotime()
strtotime()這東西比我想像聰明多了耶
/*
https://vector.cool
*/
date_default_timezone_set("Asia/Taipei");
echo strtotime("now")."<br/>";
echo strtotime("10 September 2000")."<br/>";
echo strtotime("2020-09-29 +1 day")."<br/>";
echo strtotime("+1 day")."<br/>";
echo strtotime("+1 week")."<br/>";
echo strtotime("+1 week 2 days 4 hours 2 seconds")."<br/>";;
echo strtotime("next Thursday")."<br/>";
echo strtotime("last Monday")."<br/>";Reference:http://php.net/manual/zh/function.strtotime.php
[……]
$(‘#btn’).keypress(function(e){
if((e.shiftKey && e.keyCode == 45) || e.which!=8 &&
e.which!=0 &&(e.which<48 || e.which>57))return false
});[……]