| | |
| | | * @return String |
| | | * @throws Exception |
| | | */ |
| | | public static String getNowYear() throws Exception { |
| | | public static String getNowYear() { |
| | | String nowYear = ""; |
| | | try { |
| | | String strTemp = getNowLongTime(); |
| | | nowYear = strTemp.substring(0, 4); |
| | | return nowYear; |
| | | } catch (Exception e) { |
| | | throw e; |
| | | e.printStackTrace(); |
| | | } |
| | | return nowYear; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return String |
| | | * @throws Exception |
| | | */ |
| | | public static Integer getNowMonth() throws Exception { |
| | | public static Integer getNowMonth() { |
| | | String nowMonth = ""; |
| | | try { |
| | | String strTemp = getNowLongTime(); |
| | | nowMonth = strTemp.substring(4, 6); |
| | | return Integer.valueOf(nowMonth); |
| | | } catch (Exception e) { |
| | | throw e; |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return String |
| | | * @throws Exception |
| | | */ |
| | | public static String getNowDay() throws Exception { |
| | | public static String getNowDay() { |
| | | String nowDay = ""; |
| | | try { |
| | | String strTemp = getNowLongTime(); |
| | | nowDay = strTemp.substring(6, 8); |
| | | return nowDay; |
| | | } catch (Exception e) { |
| | | throw e; |
| | | e.printStackTrace(); |
| | | } |
| | | return nowDay; |
| | | } |
| | | |
| | | /** |