| | |
| | | throw e; |
| | | } |
| | | } |
| | | public static String getShortDateStr(Date date) { |
| | | String nowDate = ""; |
| | | try { |
| | | nowDate = sdfShort.format(date); |
| | | return nowDate; |
| | | } catch (Exception e) { |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Descrption:取得当前日期,格式为:YYYY-MM-DD |
| | |
| | | return new Timestamp(System.currentTimeMillis()); |
| | | } |
| | | } |
| | | public static Date getDateFromString2(String strDate) { |
| | | if (StringUtils.isEmpty(strDate)) { |
| | | return new Date(System.currentTimeMillis()); |
| | | } |
| | | try { |
| | | return sdfLongTimePlus.parse(strDate); |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | // ----------------------------------------------------------------------- |
| | | public static Date parseFromFormats(String aValue) { |