Class DateUtils


  • public class DateUtils
    extends java.lang.Object
    日期帮助类

    官网尊重知识产权,不允许非法使用,后果自负

    Since:
    1.0
    Author:
    hubin
    • Constructor Summary

      Constructors 
      Constructor Description
      DateUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean after​(java.util.Date arg0, java.util.Date arg1)
      日期判断
      static java.lang.Long calculateDateDifference​(java.util.Date startDate, java.util.Date endDate)
      计算时间差
      static java.util.Date getCurrentDate()
      当前时间 Date 类型
      static java.util.Date loadDelayTime​(java.util.Map<java.lang.String,​java.lang.Object> extendConfig, java.lang.String key, boolean checkEmpty)
      从扩展配置中加载指定 key 延迟时间
      static java.time.LocalDateTime now()
      当前时间 LocalDateTime 类型
      static java.util.Date parseDelayTime​(java.lang.String time)
      解析延迟时间格式
      static java.util.Date toDate​(java.time.LocalDateTime localDateTime)
      日期 LocalDateTime 转为 Date
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateUtils

        public DateUtils()
    • Method Detail

      • getCurrentDate

        public static java.util.Date getCurrentDate()
        当前时间 Date 类型
        Returns:
        Date
      • now

        public static java.time.LocalDateTime now()
        当前时间 LocalDateTime 类型
        Returns:
        LocalDateTime
      • after

        public static boolean after​(java.util.Date arg0,
                                    java.util.Date arg1)
        日期判断
        Parameters:
        arg0 - 开始时间
        arg1 - 结束时间
        Returns:
        true 开始时间大于结束时间 false 开始时间小于结束时间
      • toDate

        public static java.util.Date toDate​(java.time.LocalDateTime localDateTime)
        日期 LocalDateTime 转为 Date
        Parameters:
        localDateTime - LocalDateTime
        Returns:
        Date
      • calculateDateDifference

        public static java.lang.Long calculateDateDifference​(java.util.Date startDate,
                                                             java.util.Date endDate)
        计算时间差
        Parameters:
        startDate - 开始时间
        endDate - 接受时间
        Returns:
        时间差
      • parseDelayTime

        public static java.util.Date parseDelayTime​(java.lang.String time)
        解析延迟时间格式
        Parameters:
        time - 自定义触发时间
        Returns:
        Date
      • loadDelayTime

        public static java.util.Date loadDelayTime​(java.util.Map<java.lang.String,​java.lang.Object> extendConfig,
                                                   java.lang.String key,
                                                   boolean checkEmpty)
        从扩展配置中加载指定 key 延迟时间
        Parameters:
        extendConfig - 扩展配置
        checkEmpty - 检查是否为空