public class KSDateTimeFormatter extends Object
Modifier and Type | Field and Description |
---|---|
protected org.joda.time.format.DateTimeFormatter |
formatter |
protected String |
pattern |
Constructor and Description |
---|
KSDateTimeFormatter(String pattern)
Creates a new formatter
|
Modifier and Type | Method and Description |
---|---|
String |
format(Date javaDate)
Helper method that allows a straight java.util.Date to String conversion
|
String |
format(org.joda.time.DateTime dateTime)
Formats a Joda DateTime as a String.
|
String |
format(String strDate)
Helper method that allows a straight java.util.Date to String conversion
|
org.joda.time.format.DateTimeFormatter |
getFormatter()
Get underlying Jada formatter
|
String |
getPattern()
This returns the pattern used to create the formatter
|
Date |
parse(String stringDate)
Helper method that allows for a straight string to java.util.Date conversion.
|
protected org.joda.time.format.DateTimeFormatter formatter
public KSDateTimeFormatter(String pattern)
pattern
- regex pattern for the formatpublic Date parse(String stringDate)
stringDate
- UnsupportedOperationException
- if parsing is not supportedIllegalArgumentException
- if the text to parse is invalidpublic String format(Date javaDate)
javaDate
- IllegalArgumentException
- if the javaDate is invalidpublic String format(org.joda.time.DateTime dateTime)
dateTime
- public String format(String strDate)
strDate
- IllegalArgumentException
- if the javaDate is invalidpublic org.joda.time.format.DateTimeFormatter getFormatter()
public String getPattern()
Copyright © 2004-2014 The Kuali Foundation. All Rights Reserved.