类 DateUtils

java.lang.Object
com.cdkjframework.license.util.DateUtils

public class DateUtils extends Object
  • 构造器详细资料

    • DateUtils

      public DateUtils()
  • 方法详细资料

    • getCurrentDateForFile

      public static String getCurrentDateForFile()
      获取当前时间
      返回:
      时间
    • getTime

      public static Long getTime(String time) throws GlobalException
      时间转换
      参数:
      time - 时间
      返回:
      时间戳
      抛出:
      GlobalException - 异常
    • getDate

      public static String getDate()
      获取时间
      返回:
      时间
    • date2Str

      public static String date2Str(Long time)
      时间戳转换成日期
      参数:
      time - 时间戳
      返回:
      时间
    • date2Str

      public static String date2Str(Date time)
      时间转换成字符串
      参数:
      time - 时间
      返回:
      时间字符串
    • str2Date

      public static Date str2Date(String time) throws GlobalException
      字符串转换成时间
      参数:
      time - 时间字符串
      返回:
      时间
      抛出:
      GlobalException
    • addYear

      public static Date addYear(Date date, int mount)
      时间转换成字符串
      参数:
      date - 时间
      mount - 添加的月数
      返回:
      时间字符串
    • addYear

      public static Date addYear(Long time, int mount)
      时间转换成字符串
      参数:
      time - 时间
      mount - 添加的月数
      返回:
      时间字符串
    • addMonth

      public static Date addMonth(Date date, int mount)
      添加月
      参数:
      date - 日期
      mount - 月数
      返回:
      日期
    • addMonth

      public static Date addMonth(Long time, int mount)
      获取指定时间增加指定月数后的时间
      参数:
      time - 时间
      mount - 月数
      返回:
      时间
    • addDay

      public static Date addDay(Date date, int mount)
      添加月
      参数:
      date - 日期
      mount - 月数
      返回:
      日期
    • addDay

      public static Date addDay(Long time, int mount)
      添加天
      参数:
      time - 时间戳
      mount - 天数
      返回:
      时间