public class DateUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
convertDateToString(Date aDate)
This method generates a string representation of a date based on the
System Property 'dateFormat' in the format you specify on input
|
static Date |
convertStringToDate(String strDate)
This method converts a String to a date using the datePattern
|
static Date |
convertStringToDate(String aMask,
String strDate)
This method generates a string representation of a date/time in the
format you specify on input
|
static String |
getDate(Date aDate)
This method attempts to convert an Oracle-formatted date in the form
dd-MMM-yyyy to mm/dd/yyyy.
|
static String |
getDatePattern()
Return default datePattern (MM/dd/yyyy)
|
static String |
getDateTime(String aMask,
Date aDate)
This method generates a string representation of a date's date/time in
the format you specify on input
|
static String |
getDateTimePattern() |
static String |
getTimeNow(Date theTime)
This method returns the current date time in the format: MM/dd/yyyy HH:MM
a
|
static Calendar |
getToday()
This method returns the current date in the format: MM/dd/yyyy
|
public static String getDatePattern()
public static String getDateTimePattern()
public static String getDate(Date aDate)
aDate
- date from database as a stringpublic static Date convertStringToDate(String aMask, String strDate) throws ParseException
aMask
- the date pattern the string is instrDate
- a string representation of a dateParseException
- when String doesn't match the expected formatSimpleDateFormat
public static String getTimeNow(Date theTime)
theTime
- the current timepublic static Calendar getToday() throws ParseException
ParseException
- when String doesn't match the expected formatpublic static String getDateTime(String aMask, Date aDate)
aMask
- the date pattern the string is inaDate
- a date objectSimpleDateFormat
public static String convertDateToString(Date aDate)
aDate
- A date to convertpublic static Date convertStringToDate(String strDate) throws ParseException
strDate
- the date to convert (in format MM/dd/yyyy)ParseException
- when String doesn't match the expected formatCopyright © 2015. All rights reserved.