com.mhuss.Util
Class DateU
- java.lang.Object
-
- com.mhuss.Util.DateU
-
public class DateU extends java.lang.ObjectA 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.Stringdate(java.util.Date d)Convert a Date into a date String using the default Locale and the DateFormat.MEDIUM size.static java.lang.Stringdate(java.util.Date d, int dateFmt)Convert a Date into a date String using the default Locale.static java.lang.StringdateNow()Return 'now' as a date String using the default Locale and the DateFormat.MEDIUM size.static java.lang.StringdateNow(int dateFmt)Return 'now' as a date String using the default Localestatic java.lang.StringdateTime(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.StringdateTime(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.StringdateTime(java.util.Date d, int dtFmt)Convert a Date into a date and time String using the default Localestatic java.lang.StringdateTimeNow()Return 'now' as a date and time String using the default Locale and the DateFormat.MEDIUM size.static java.lang.Stringtime(java.util.Date d)Convert a Date into a time String using the default Locale and the DateFormat.MEDIUM size.static java.lang.Stringtime(java.util.Date d, int dateFmt)Convert a Date into a time String using the default Locale
-
-
-
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 convertdateFmt- 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 convertdateFmt- 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 convertdtFmt- 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