モジュール pro.eng.yui.YuiFramework

インタフェース IDateUtil


public interface IDateUtil
Define common Date/Calendar operations
導入されたバージョン:
1.0.0
バージョン:
1.1.0
作成者:
yui-KITAMURA
  • メソッドの詳細

    • now

      @Contract(" -> new") Calendar now()
      Get Calendar instance of current DateTime.
      戻り値:
      instance of current DateTime
    • toDate

      @Contract("null -> null; !null -> new") Date toDate(Calendar calendar)
      Convert Calendar to Date null-safe
      パラメータ:
      calendar - original instance of Calendar
      戻り値:
      the Date instance that has same timestamp with parameter
    • toCal

      @Contract("null -> null; !null-> new") Calendar toCal(Date date)
      Convert Date to Calendar null-safe
      パラメータ:
      date - original instance of Date
      戻り値:
      the Calendar instance that has same timestamp with parameter
    • toStr

      @Contract("null, null -> fail; null, _ -> null; !null, _ -> new") String toStr(Calendar calendar, IDateUtil.Formats format)
      String formatter with IDateUtil.Formats
      パラメータ:
      calendar - Calendar instance to be formatted
      format - the output format that you want to get
      戻り値:
      the string value which the argument of calendar formatted with selected format
    • toStr

      @Contract("null, null -> fail; null, _ -> null; !null, _ -> new") String toStr(Date date, IDateUtil.Formats format)
      String formatter with IDateUtil.Formats
      パラメータ:
      date - Date instance to be formatted
      format - the output format that you want to get
      戻り値:
      the string value which the argument of date formatted with selected format
    • fromStr

      @Contract("null, null -> fail; null, _ -> null; !null, _ -> new") Calendar fromStr(String input, IDateUtil.Formats format)
      Convert String to Calendar with format
      パラメータ:
      input - convert target text
      format - the text format
      戻り値:
      the Calendar instance which has the time given with the input
      例外:
      IllegalArgumentException - when failed to convert
      導入されたバージョン:
      1.1.0
    • toTS

      @Contract("null -> null; !null -> new") Timestamp toTS(Calendar calendar)
      Convert Calendar to Timestamp
      パラメータ:
      calendar - original Calendar instance
      戻り値:
      the Timestamp instance that has same DateTime with argument
    • toTS

      @Contract("null -> null; !null -> new") Timestamp toTS(Date date)
      Convert Date to Timestamp
      パラメータ:
      date - original Date instance
      戻り値:
      the Timestamp instance that has same DateTime with argument