From f3cd78cd0355259a7f08cab33df69e0ac3a6850d Mon Sep 17 00:00:00 2001 From: chenjiahe <763432473@qq.com> Date: 星期四, 26 五月 2022 18:12:27 +0800 Subject: [PATCH] mybatis时间转化文件 --- src/main/java/com/hx/util/DateUtil.java | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/hx/util/DateUtil.java b/src/main/java/com/hx/util/DateUtil.java index 9669b94..258a55e 100644 --- a/src/main/java/com/hx/util/DateUtil.java +++ b/src/main/java/com/hx/util/DateUtil.java @@ -202,6 +202,20 @@ return Format_14.format(date); } + + /** + * 褰撳墠鏃堕棿涔嬪墠鐨勬椂闂翠笌褰撳墠鏃堕棿鐩稿樊澶氬皯绉� + * @param startDate 褰撳墠鏃堕棿涔嬪墠鐨勬椂闂� + * @return + */ + public static int calLastedTime(Date startDate) { + long nowDate = new Date().getTime(); + long startDateTime = startDate.getTime(); + int diffSeconds = (int) ((nowDate - startDateTime) / 1000); + return diffSeconds; + } + + /** * 杞崲鎴恲yyyMMddHHmmssSSS鏍煎紡鐨勬棩鏈熷瓧绗︿覆 * -- Gitblit v1.8.0