Class ScheduleDateTimeUtil

java.lang.Object
com._1c.g5.v8.dt.schedule.model.util.ScheduleDateTimeUtil

public class ScheduleDateTimeUtil extends Object
Schedule model date and time utils
  • Field Details

    • DEFAULT_DATE_TIME

      public static final Date DEFAULT_DATE_TIME
      The default date time value for schedule
    • DATE_PATTERN

      public static final String DATE_PATTERN
      The default date format pattern for schedule
      See Also:
    • TIME_PATTERN

      public static final String TIME_PATTERN
      The default time format pattern for schedule
      See Also:
    • DEFAULT_DATE

      public static final String DEFAULT_DATE
      The default date string value for schedule
      See Also:
    • DEFAULT_TIME

      public static final String DEFAULT_TIME
      The default time string value for schedule
      See Also:
  • Method Details

    • dateToString

      public static String dateToString(Date date)
      Convert specifed Date to text
      Parameters:
      date - the specifed Date to convert, can be null
      Returns:
      converted date text, or default date value if given date is null
    • dateFromString

      public static Date dateFromString(String date) throws ParseException
      Convert specifed text to Date
      Parameters:
      date - the specifed String to convert, can be null
      Returns:
      converted date, or default date value if given text is null
      Throws:
      ParseException - if the beginning of the specified string cannot be parsed.
    • timeToString

      public static String timeToString(Date time)
      Convert specifed time to text
      Parameters:
      time - the specifed time to convert, can be null
      Returns:
      converted time text, or default time value if given time is null
    • timeFromString

      public static Date timeFromString(String time) throws ParseException
      Convert specifed text to time
      Parameters:
      time - the specifed String to convert, can be null
      Returns:
      converted time, or default time value if given text is null
      Throws:
      ParseException - if the beginning of the specified string cannot be parsed.
    • todayMidnight

      public static Date todayMidnight()
      Today midnight day time
      Returns:
      the instance of today midnight day time, never null