|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.openfoundation.util.XPDateFormat
Collection of date format objects based off of the locale, timezone and if you want a short or long display.
Field Summary | |
static int |
DEFAULT
DEFAULT - display the default date format, which is the same as MEDIUM in java. |
static int |
FULL
Display the FULL date format. |
static int |
LONG
Display the LONG date format. |
static int |
MEDIUM
Display the MEDIUM date format. |
static int |
SHORT
Display the SHORT format. |
Method Summary | |
void |
ApplyLocalizedPattern(java.lang.String pattern)
Apply the given pattern string to this date format, also mapping any formatting characters with a preferred representation in the underlying locale; for example, MM/dd/yy might be mapped to MM-dd-yy. |
void |
ApplyPattern(java.lang.String pattern)
Apply the given pattern string to this date format instance, subject to restrictions to make the pattern suitable for cross- platform use on Java and .NET. |
java.lang.String |
Format(XPDateTime d)
Returns a formatted date with the selected length, using the default locale and timezone of the server. |
java.lang.String[] |
GetAmPmStrings()
Returns an array of AM, PM strings. |
static XPDateFormat |
GetDateInstance(int datetype)
Create an XPDateFormat object. |
static XPDateFormat |
GetDateInstance(int datetype,
XPLocale locale,
XPTimeZone timezone)
Create an XPDateFormat object. |
static XPDateFormat |
GetDateTimeInstance(int datetype,
int timetype)
Create an XPDateFormat object. |
static XPDateFormat |
GetDateTimeInstance(int datetype,
int timetype,
XPLocale locale,
XPTimeZone timezone)
Create an XPDateFormat object. |
static XPDateFormat |
GetTimeInstance(int timetype)
Create an XPDateFormat object. |
static XPDateFormat |
GetTimeInstance(int timetype,
XPLocale locale,
XPTimeZone timezone)
Create an XPDateFormat object. |
XPDateTime |
Parse(java.lang.String in)
Creates an XPDateTime from a string, attempting to parse it according to the instance of the XPDateFormat previously supplied. |
java.lang.String |
ToPattern()
Returns the pattern string describing this format. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SHORT
public static final int MEDIUM
public static final int LONG
public static final int FULL
public static final int DEFAULT
Method Detail |
public static final XPDateFormat GetDateInstance(int datetype)
datetype
- - the type you want either SHORT or LONG
public static final XPDateFormat GetDateInstance(int datetype, XPLocale locale, XPTimeZone timezone)
datetype
- - the type you want either SHORT or LONGlocale
- - the localetimezone
- - the timezone
public static final XPDateFormat GetTimeInstance(int timetype)
timetype
- - the type you want either SHORT or LONG
public static final XPDateFormat GetTimeInstance(int timetype, XPLocale locale, XPTimeZone timezone)
timetype
- - the type you want either SHORT or LONGlocale
- - the localetimezone
- - the timezone
public static final XPDateFormat GetDateTimeInstance(int datetype, int timetype)
datetype
- - the date type you want either SHORT or LONGtimetype
- - the time type you want either SHORT or LONG
public static final XPDateFormat GetDateTimeInstance(int datetype, int timetype, XPLocale locale, XPTimeZone timezone)
datetype
- - the date type you want either SHORT or LONGtimetype
- - the time type you want either SHORT or LONGlocale
- - the localetimezone
- - the timezone
public java.lang.String Format(XPDateTime d)
d
- - the date you wish to format.
public void ApplyPattern(java.lang.String pattern)
Format Character(s) | Meaning | Comments |
yy yyyy | Two- or four-digit year. | |
d dd | Day of month 1-31 or 01-31. | Note that ddd and dddd alias internal .NET idioms. |
EEE EEEE | Day of week, for example Wed or Wednesday | Note that these translate to ddd and dddd internally in .NET . |
M MM MMM MMMM | Month, for example 7 07 Jul or July | |
h hh | Hours 1-12, for example 9 09 | |
H HH | Hours 0-24, for example 9 09 or 21 21. | |
m mm | minutes 0-59, for example 3 or 03 | |
s ss | seconds 0-59, for example 3 or 03 | |
SSSS | Fractions of a second 0000-9999. | Translates to ffff internally in .NET. |
a | AM/PM as indicated per locale. | Translates internally to tt in .NET . |
z | Short time zone name favoring U.S. usage, for example PST. May be ambiguous in world-wide usage. | Handled via custom code in XPDateFormat .NET, no direct correspondence. |
pattern
- - the formatting pattern to be applied.
XPIllegalArgumentException
- on a pattern containing format characters not mappable to .NET.public void ApplyLocalizedPattern(java.lang.String pattern)
pattern
- - the formatting pattern to be appliedpublic java.lang.String[] GetAmPmStrings()
public XPDateTime Parse(java.lang.String in)
XPDateFormat.ApplyPattern
. It may be necessary
to hand-code a date parser if flexibility in format
is needed.
XPDateFormat.SHORT
, XPDateFormat.MEDIUM
,
XPDateFormat.LONG
, XPDateFormat.FULL
for options.
in
- - the date string to parse
XPFormatException
- if the input string does not match the underlying date format pattern.public java.lang.String ToPattern()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |