Commit 64377a5547c74db859cbe1effdbb7079376d05e6
1 parent
32cdc51684
Exists in
master
and in
6 other branches
1
Showing 1 changed file with 12 additions and 0 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
64377a5
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | public static SimpleDateFormat yyyy = new SimpleDateFormat("yyyy"); |
| 17 | 17 | public static SimpleDateFormat ymd = new SimpleDateFormat("yyyyMMdd"); |
| 18 | 18 | public static SimpleDateFormat y_m_d = new SimpleDateFormat("yyyy-MM-dd"); |
| 19 | + | |
| 20 | + public static SimpleDateFormat y_m_d1= new SimpleDateFormat("yyyy年MM月dd日"); | |
| 19 | 21 | public static SimpleDateFormat md = new SimpleDateFormat("MM-dd"); |
| 20 | 22 | public static SimpleDateFormat m_d = new SimpleDateFormat("MM/dd"); |
| 21 | 23 | public static SimpleDateFormat y_m_d_h_m_s = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| ... | ... | @@ -322,6 +324,16 @@ |
| 322 | 324 | } |
| 323 | 325 | try { |
| 324 | 326 | return y_m_d.format(d); |
| 327 | + } catch (Exception e) { | |
| 328 | + return null; | |
| 329 | + } | |
| 330 | + } | |
| 331 | + public static String getyyyy_MM_dd1(Date d) { | |
| 332 | + if (d == null) { | |
| 333 | + return null; | |
| 334 | + } | |
| 335 | + try { | |
| 336 | + return y_m_d1.format(d); | |
| 325 | 337 | } catch (Exception e) { |
| 326 | 338 | return null; |
| 327 | 339 | } |