最近总用Java读取文件,发现了一种我个人觉得比较好的方法,现在分享给大家 public static void main(String[] args) throws Exception { FileInputStream f = new FileInputStream("文件路径"); InputStreamReader fileInputStream = new InputStreamReader(f); BufferedReader br = new BufferedReader
//将毫秒转换成时分秒 public string formatLongToTimeStr(long a) { try { int hour = 0; int minute = 0; int second = 0; second = Convert.ToInt32(a) / 1000; if (second > 60) { minute = second / 60; second = second % 60; } if (minute > 60) { hour = minute / 60; m
<script> function datetime_to_unix(datetime){ var tmp_datetime = datetime.replace(/:/g,'-'); tmp_datetime = tmp_datetime.replace(/ /g,'-'); var arr = tmp_datetime.split("-"); var now = new Date(Date.UTC(arr[0
function dateCover(str) { let isDate = new Date( + str); let year = isDate.getFullYear(); let monthGet = (isDate.getMonth() + 1); let month = monthGet < 10 ? "0" + monthGet: monthGet; let datesGet = isDate.getDate(); let dates = datesGet <