From 7b07dc50f2696954ed7ab2e1c30b40d7c45ef0c5 Mon Sep 17 00:00:00 2001 From: ChenJiaHe <763432473@qq.com> Date: 星期三, 25 十一月 2020 18:26:01 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/huoxiong/hx_common --- src/main/java/com/hx/util/DateUtil.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/util/DateUtil.java b/src/main/java/com/hx/util/DateUtil.java index a7e8001..a2484b8 100644 --- a/src/main/java/com/hx/util/DateUtil.java +++ b/src/main/java/com/hx/util/DateUtil.java @@ -233,6 +233,29 @@ return sdf.parse(str); } + /**瀛楃涓茶浆鎴愭椂闂磞yyy-MM-dd HH:mm:ss*/ + public static Date parseString_1(String str) + { + try{ + return Format_3.parse(str); + }catch (Exception e) + { + return null; + } + } + + /**瀛楃涓茶浆鎴愭椂闂磞yyy-MM-dd*/ + public static Date parseString_2(String str) + { + try{ + return Format_4.parse(str); + }catch (Exception e) + { + return null; + } + } + + /**鏃堕棿涓婂垎閽熷彔鍔� * @Author: ChenJiaHe * @param dateTime 鏃堕棿 @@ -392,4 +415,24 @@ return status; } + /**鎶婄杞崲鎴怷澶鏃禭鍒哫绉�*/ + public static String getChineseStr(Integer second) + { + int day = 24 * 60 * 60; + int hour = 60 * 60; + int min = 60; + + int dayNum = second / day; + int hourNum = second % day / hour; + int minNum = second % day % hour / min; + second = second % day % hour % min; + + String str = dayNum > 0 ? dayNum + "澶�" : ""; + str += hourNum > 0 ? hourNum + "鏃�" : ""; + str += minNum > 0 ? minNum + "鍒�" : ""; + str += second + "绉�"; + + return str; + } + } -- Gitblit v1.8.0