時間工具類

2021-10-20 04:23:18 字數 964 閱讀 4399

public class timeutils 

/*** 獲取帶連線符的日期型別

* @return

*/public static string getcurrentnormaldate()

/*** 獲取當年的年份

* @return

*/public static int getcurrentyear()

/*** 獲取當年的月份

* @return

*/public static int getcurrentmonth()

/*** 獲取當前年份的後兩位

* @return

*/public static string getcurrentshortyear()

/*** 獲取當前的年和月

* @return

*/public static string getcurrentyearandmonth()

/*** 生成年月

* @return

*/public static string getcurrentshortyearandmonth()

/*** 獲取當前時間

* @return

*/public static date getcurrentdate()

/***

* 判斷字串是否是 hh:mm:ss 格式

* @param datetime 字串

* @return boolean 是否包含日期格式

*/public static boolean inclusiontime(string datetime)

return false;

}/**

* 獲取當前日期在本月是第幾周

* @return

*/public static int getweekofmonth()

}

時間工具類

獲取當前時間 年月日時分秒 test public void nowdate 獲取任意過去或者未來的現在時間 test public void pastorfuturedate 獲取任意兩個時間之間相差多少秒 test public void anytwotimedifference throws ...

時間工具類

1 根據日期獲取當天是週幾 根據日期獲取當天是週幾 param datetime 日期 return 週幾 author lu since 1.0,2020年7月30日 public static string getweekofdate date datetime calendar calenda...

時間工具類

隨手記錄 string轉date時間 param time 時間字串 param format 格式 return author ydl date 2020 09 17 public static date formatdate string time,string format dateforma...