public class DateUtilStaticExtensions extends Object
Constructor and Description |
---|
DateUtilStaticExtensions() |
Modifier and Type | Method and Description |
---|---|
static Date |
parse(Date self,
String format,
String input)
Parse a String into a Date instance using the given pattern.
|
static Date |
parse(Date self,
String format,
String input,
TimeZone zone)
Parse a String into a Date instance using the given pattern and TimeZone.
|
static Date |
parseToStringDate(Date self,
String dateToString)
Parse a String matching the pattern EEE MMM dd HH:mm:ss zzz yyyy
containing US-locale-constants only (e.g.
|
public static Date parse(Date self, String format, String input) throws ParseException
SimpleDateFormat
.
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
self
- placeholder variable used by Groovy categories; ignored for default static methodsformat
- pattern used to parse the input string.input
- String to be parsed to create the date instanceParseException
- if there is a parse errorDateFormat.parse(java.lang.String)
public static Date parse(Date self, String format, String input, TimeZone zone) throws ParseException
SimpleDateFormat
.
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
self
- placeholder variable used by Groovy categories; ignored for default static methodsformat
- pattern used to parse the input string.input
- String to be parsed to create the date instancezone
- TimeZone to use when parsingParseException
- if there is a parse errorDateFormat.parse(java.lang.String)
public static Date parseToStringDate(Date self, String dateToString) throws ParseException
Date
Note that a new SimpleDateFormat instance is created for every invocation of this method (for thread safety).
self
- placeholder variable used by Groovy categories; ignored for default static methodsdateToString
- String to be parsed to create the date instance. Must match the pattern EEE MMM dd HH:mm:ss zzz yyyy with US-locale symbolsParseException
- if there is a parse error