Class MDate

    • Field Detail

      • NULL_DATE

        public static final Date NULL_DATE
    • Constructor Detail

      • MDate

        public MDate()
      • MDate

        public MDate​(long date)
      • MDate

        public MDate​(Timestamp timestamp)
      • MDate

        public MDate​(String string)
    • Method Detail

      • toSqlDate

        public Date toSqlDate()
      • toSqlTime

        public Time toSqlTime()
      • toSqlTimestamp

        public Timestamp toSqlTimestamp()
      • toCalendar

        public Calendar toCalendar()
      • isEarlierAs

        public static boolean isEarlierAs​(Date a,
                                          Date b)
      • isLaterAs

        public static boolean isLaterAs​(Date a,
                                        Date b)
      • isWorkDay

        public static boolean isWorkDay​(Date date)
      • isWeekend

        public static boolean isWeekend​(Date date)
      • toIso8601

        public static String toIso8601​(Date date)
        yyyy-MM-ddTHH:mm:ss
        Parameters:
        date -
        Returns:
        the formatted date as string
      • toIso8601

        public static String toIso8601​(long timestamp)
      • toDateTimeString

        public static String toDateTimeString​(Date date)
      • toDateTimeString

        public static String toDateTimeString​(Date date,
                                              Locale locale)
      • toDateTimeSecondsString

        public static String toDateTimeSecondsString​(Date date)
      • toDateTimeSecondsString

        public static String toDateTimeSecondsString​(Date date,
                                                     Locale locale)
      • toDateString

        public static String toDateString​(Date date)
      • toDateString

        public static String toDateString​(Date date,
                                          Locale locale)
      • getLocaleDateFormatter

        public static DateFormat getLocaleDateFormatter​(Locale locale)
        Returns a locale specific date formatter.
        Parameters:
        locale - the locale or null for default locale
        Returns:
        date formatter
      • toFileFormat

        public static String toFileFormat​(Date date)
        yyyyMMddHHmmss
        Parameters:
        date -
        Returns:
        the formatted date as string
      • toIsoDate

        public static String toIsoDate​(Date _in)
        Returns the date in iso format: yyyy-mm-dd
        Parameters:
        _in -
        Returns:
        the formatted date as string
      • toIsoDateTime

        public static String toIsoDateTime​(Date _in)
        Returns the date in iso time format: yyyy-mm-dd HH:mm:ss.SSS
        Parameters:
        _in -
        Returns:
        the formatted date as string
      • toIsoDateTime

        public static String toIsoDateTime​(Calendar _in)
      • toIsoDateTime

        public static String toIsoDateTime​(long timeStamp)
        Calendar to iso date: yyyy-mm-dd
        Parameters:
        timeStamp -
        Returns:
        the formatted date as string
      • toIsoDate

        public static String toIsoDate​(Calendar _in)
        Calendar to iso date: yyyy-mm-dd
        Parameters:
        _in -
        Returns:
        the formatted date as string
      • toIso8601

        public static String toIso8601​(Calendar date)
        yyyy-MM-ddTHH:mm:ss
        Parameters:
        date -
        Returns:
        the formatted date as string
      • toFileFormat

        public static String toFileFormat​(Calendar date)
        yyyyMMddHHmmss
        Parameters:
        date -
        Returns:
        the formatted date as string
      • toTimeString

        public static String toTimeString​(Date date)
      • toTimeSecondsString

        public static String toTimeSecondsString​(Date date)
      • toTimeSecondsString

        public static String toTimeSecondsString​(Date date,
                                                 TimeZone tz)
      • toDateOnly

        public static Date toDateOnly​(Date date)
      • lastDayOfMonth

        public static int lastDayOfMonth​(int month,
                                         int year)
        Calculate the last day of the defined month.
        Parameters:
        month - 0 - 11
        year - YYYY
        Returns:
        The last day of the month 1 - 31
      • toHttpHeaderDate

        public static String toHttpHeaderDate​(long date)
      • toHttpHeaderDate

        public static String toHttpHeaderDate​(Date date)