Java之美 獲取某一時間段特定星期幾的日期

2021-09-01 18:57:53 字數 1173 閱讀 2842

/**

* 獲取某一時間段特定星期幾的日期

* @author finder.zhou

*/public class weekdayutil

/*** 獲取某一時間段特定星期幾的日期

* @param datefrom 開始時間

* @param dateend 結束時間

* @param weekdays 星期

* @return 返回時間陣列

*/public static string getdates(string datefrom, string dateend, string weekdays)

} else

}} catch (parseexception e1)

string datearray = new string[datelist.size()];

datelist.toarray(datearray);

return datearray;

}//等到當期時間的周係數。星期日:1,星期一:2,星期二:3,星期三:4,星期四:5,星期五:6,星期六:7

public static integer dayforweek(date date)

/*** 得到對應星期的係數 星期日:1,星期一:2,星期二:3,星期三:4,星期四:5,星期五:6,星期六:7

* @param weekdays 星期格式 星期一|星期二

*/public static string weekfornum(string weekdays)

}else

return weeknumber;

}//將星期轉換為對應的係數 星期日:1,星期一:2,星期二:3,星期三:4,星期四:5,星期五:6,星期六:7

public static integer getweeknum(string strweek)else if("星期一".equals(strweek))else if("星期二".equals(strweek))else if("星期三".equals(strweek))else if("星期四".equals(strweek))else if("星期五".equals(strweek))else if("星期六".equals(strweek))else

return number;

}}

Linux檢視某一時間段的命令

今天我想在十幾個g的日誌檔案中檢視某個時間的日誌,使用 tail n 日誌檔名 滑動滑鼠,想找到那一時間的日誌,結果頁麵條數受限 然後,查到了可以檢視某一時間段的日誌的操作命令,如下 sed n 2020 09 24 11 16 00 2020 09 24 11 20 00 p log.out注意 ...

判斷某一時間在某個時間段內

判斷當前時間是否在 starttime,endtime 區間,注意時間格式要一致 param submissiondate 當前時間 param starttime 開始時間 資料庫查出來 param endtime 結束時間 查出來 public static boolean iseffectiv...

MySQL查詢某一時間段的SQL語句

今天 select from 表名 where 時間欄位名 curdate 昨天 select from 表名 where 時間欄位名 date sub curdate interval 1 day and 時間欄位名 curdate 近7天 select from 表名 where 時間欄位名 d...