mysql 獲取凌晨時間戳 當前凌晨時間戳

2021-10-17 19:30:20 字數 905 閱讀 9265

echo strtotime(date('y-m-d'));

獲取明天凌晨的時間戳

**:echo strtotime(date('y-m-d',strtotime('+1 day')));

附上測試**:

echo strtotime('2012-11-2');

echo strtotime('2012-11-2 00:00:00');

echo strtotime(date('y-m-d')),'

echo date('y-m-d h:i:s',strtotime(date('y-m-d')));

echo strtotime(date('y-m-d',strtotime('+1 day')));

echo ( strtotime(date('y-m-d',strtotime('+1 day'))) - strtotime(date('y-m-d')) )/3600;

echo "一周後:".date("y-m-d",strtotime("+1 week"));

echo "一周零兩天四小時兩秒後:".date("y-m-d g:h:s",strtotime("+1 week 2 days 4 hours 2 seconds"));

echo "下個星期四:".date("y-m-d",strtotime("next thursday"));

echo "上個周一:".date("y-m-d",strtotime("last monday"));

echo "乙個月前:".date("y-m-d",strtotime("last month"));

echo "乙個月後:".date("y-m-d",strtotime("+1 month"));

echo "十年後:".date("y-m-d",strtotime("+10 year"));

iOS 獲取當前時間和當前時間戳

獲取當前的時間 nsstring getcurrenttimes nsdateformatter formatter nsdateformatter alloc init 設定你想要的格式,hh與hh的區別 分別表示12小時制,24小時制 formatter setdateformat yyyy m...

iOS 獲取當前時間和當前時間戳

獲取當前的時間 nsstring getcurrenttimes nsdateformatter formatter nsdateformatter alloc init 設定你想要的格式,hh與hh的區別 分別表示12小時制,24小時制 formatter setdateformat yyyy m...

微信小程式獲取當前時間戳 獲取當前時間 時間戳加減

獲取當前時間戳 var timestamp date.parse new date timestamp timestamp 1000 console.log 當前時間戳為 timestamp 獲取當前時間 var n timestamp 1000 var date new date n 年 var ...