Class ScheduleDateTimeUtil


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

      • DEFAULT_DATE_TIME

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

      • 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