クラス DateUtils

java.lang.Object
org.thinkit.bot.filater.util.DateUtils

public final class DateUtils
extends Object
It provides common functions for date operation.
導入されたバージョン:
1.0.0
  • コンストラクタの概要

    コンストラクタ
    コンストラクタ 説明
    DateUtils()  
  • メソッドの概要

    修飾子とタイプ メソッド 説明
    static Date getDateAfter​(DateFormat dateFormat, long timeMs, int days)
    Returns the date represented by timeMs add days according to the dateFormat passed as an argument.
    static Date getDateAfter​(DateFormat dateFormat, Date date, int days)
    Returns the date add days according to the dateFormat passed as an argument.
    static Date now()
    Returns the current date.
    static Date toDate​(DateFormat dateFormat, long timeMs)
    Converts milliseconds to dates according to dateFormat passed as an argument and returns it.
    static String toString​(DateFormat dateFormat, Date date)
    Converts date to string date according to dateFormat passed as an argument and returns it.

    クラスから継承されたメソッド java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • コンストラクタの詳細

    • DateUtils

      public DateUtils()
  • メソッドの詳細

    • now

      public static Date now()
      Returns the current date.
      戻り値:
      The current date
    • getDateAfter

      public static Date getDateAfter​(@NonNull DateFormat dateFormat, long timeMs, int days)
      Returns the date represented by timeMs add days according to the dateFormat passed as an argument.
      パラメータ:
      dateFormat - The date format
      timeMs - The date [ms]
      days - The days to be added
      戻り値:
      The date that added days passed as an argument
      例外:
      NullPointerException - If null is passed as an argument
    • getDateAfter

      public static Date getDateAfter​(@NonNull DateFormat dateFormat, @NonNull Date date, int days)
      Returns the date add days according to the dateFormat passed as an argument.
      パラメータ:
      dateFormat - The date format
      date - The date
      days - The days to be added
      戻り値:
      The date that added days passed as an argument
      例外:
      NullPointerException - If null is passed as an argument
    • toDate

      public static Date toDate​(@NonNull DateFormat dateFormat, long timeMs)
      Converts milliseconds to dates according to dateFormat passed as an argument and returns it.
      パラメータ:
      dateFormat - The date format
      timeMs - The milliseconds represents the date
      戻り値:
      The date
      例外:
      NullPointerException - If null is passed as an argument
    • toString

      public static String toString​(@NonNull DateFormat dateFormat, Date date)
      Converts date to string date according to dateFormat passed as an argument and returns it.
      パラメータ:
      dateFormat - The date format
      date - The date
      戻り値:
      The string date
      例外:
      NullPointerException - If null is passed as an argument