Documentation of 'com.mhuss.Util.DateU' Java class
DateU
com.mhuss.Util

Class DateU



  • public class DateU
    extends java.lang.Object
    A simple set of date and time formatters. This once trivial task got a bit complicated after the addition of i18n support.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DateU() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String date(java.util.Date d)
      Convert a Date into a date String using the default Locale and the DateFormat.MEDIUM size.
      static java.lang.String date(java.util.Date d, int dateFmt)
      Convert a Date into a date String using the default Locale.
      static java.lang.String dateNow()
      Return 'now' as a date String using the default Locale and the DateFormat.MEDIUM size.
      static java.lang.String dateNow(int dateFmt)
      Return 'now' as a date String using the default Locale
      static java.lang.String dateTime(java.util.Calendar c)
      Convert a Calendar into a date and time String using the default Locale and the DateFormat.MEDIUM size.
      static java.lang.String dateTime(java.util.Date d)
      Convert a Date into a date and time String using the default Locale and the DateFormat.MEDIUM size.
      static java.lang.String dateTime(java.util.Date d, int dtFmt)
      Convert a Date into a date and time String using the default Locale
      static java.lang.String dateTimeNow()
      Return 'now' as a date and time String using the default Locale and the DateFormat.MEDIUM size.
      static java.lang.String time(java.util.Date d)
      Convert a Date into a time String using the default Locale and the DateFormat.MEDIUM size.
      static java.lang.String time(java.util.Date d, int dateFmt)
      Convert a Date into a time String using the default Locale
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateU

        public DateU()
    • Method Detail

      • dateNow

        public static java.lang.String dateNow(int dateFmt)
        Return 'now' as a date String using the default Locale
        Parameters:
        dateFmt - The java.text.DateFormat constant to use (FULL, LONG, MEDIUM, or SHORT).
        Returns:
        The current, formatted, date as a String
      • dateNow

        public static java.lang.String dateNow()
        Return 'now' as a date String using the default Locale and the DateFormat.MEDIUM size.
        Returns:
        The current formatted date as a String
      • dateTimeNow

        public static java.lang.String dateTimeNow()
        Return 'now' as a date and time String using the default Locale and the DateFormat.MEDIUM size.
        Returns:
        The current, formatted, date and time as a String
      • date

        public static java.lang.String date(java.util.Date d,
                                            int dateFmt)
        Convert a Date into a date String using the default Locale.
        Parameters:
        d - The java.util.Date to convert
        dateFmt - The java.text.DateFormat constant to use (FULL, LONG, MEDIUM, or SHORT).
        Returns:
        The date formatted as a String
      • date

        public static java.lang.String date(java.util.Date d)
        Convert a Date into a date String using the default Locale and the DateFormat.MEDIUM size.
        Parameters:
        d - The java.util.Date to convert
        Returns:
        The date formatted as a String
      • time

        public static java.lang.String time(java.util.Date d,
                                            int dateFmt)
        Convert a Date into a time String using the default Locale
        Parameters:
        d - The java.util.Date to convert
        dateFmt - The java.text.DateFormat constant to use (FULL, LONG, MEDIUM, or SHORT).
        Returns:
        The time formatted as a String
      • time

        public static java.lang.String time(java.util.Date d)
        Convert a Date into a time String using the default Locale and the DateFormat.MEDIUM size.
        Parameters:
        d - The java.util.Date to convert
        Returns:
        The time formatted as a String
      • dateTime

        public static java.lang.String dateTime(java.util.Date d,
                                                int dtFmt)
        Convert a Date into a date and time String using the default Locale
        Parameters:
        d - The java.util.Date to convert
        dtFmt - The java.text.DateFormat constant to use (FULL, LONG, MEDIUM, or SHORT).
        Returns:
        The date and time formatted as a String
      • dateTime

        public static java.lang.String dateTime(java.util.Date d)
        Convert a Date into a date and time String using the default Locale and the DateFormat.MEDIUM size.
        Parameters:
        d - The java.util.Date to convert
        Returns:
        The date and time formatted as a String
      • dateTime

        public static java.lang.String dateTime(java.util.Calendar c)
        Convert a Calendar into a date and time String using the default Locale and the DateFormat.MEDIUM size.
        Parameters:
        c - The java.util.Calendar to convert
        Returns:
        The date and time formatted as a String

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.