org.axiondb.util
public final class DateTimeUtils extends Object
Version: $Revision: 1.11 $ $Date: 2005/12/20 18:32:42 $
Field Summary | |
---|---|
static int | DAY Constant representing day interval |
static int | HOUR Constant representing hour time interval |
static int | MILLISECOND Constant representing millisecond time interval |
static int | MINUTE Constant representing minute time interval |
static int | MONTH Constant representing month interval |
static int | QUARTER Constant representing quarter interval |
static int | SECOND Constant representing second time interval |
static int | WEEK Constant representing week interval |
static int | YEAR Constant representing year interval |
Method Summary | |
---|---|
static String | convertToChar(Timestamp timestamp, String formatStr)
Creates a String representation of the given Timestamp object, using
the given format string as a template and the current Axion time zone.
|
static String | convertToChar(Timestamp timestamp, String formatStr, TimeZone timezone)
Creates a String representation of the given Timestamp object, using
the given format string as a template, the given time zone, and the
current default Locale.
|
static String | convertToChar(Timestamp timestamp, String formatStr, TimeZone timezone, Locale locale)
Creates a String representation of the given Timestamp object, using
the given format string as a template, the given time zone, and the
given Locale.
|
static Timestamp | convertToTimestamp(String dateStr, String formatStr)
Creates a String representation of the given Timestamp object, using
the given format string as a template and the current Axion time zone.
|
static Timestamp | convertToTimestamp(String dateStr, String formatStr, TimeZone timezone)
Creates a String representation of the given Timestamp object, using
the given format string as a template and the given time zone.
|
static Timestamp | convertToTimestamp(String dateStr, String formatStr, TimeZone timezone, Locale locale)
Creates a String representation of the given Timestamp object, using
the given format string as a template, the given time zone, and the
given Locale
|
static String | getDatePart(Timestamp t, String partIdent)
Extracts the specified date/time element from the given Timestamp,
using the default Locale.
|
static String | getDatePart(Timestamp t, String partIdent, Locale locale)
Extracts the specified date/time element from the given Timestamp,
using the given Locale.
|
static String | getPartMnemonicFor(String partString) |
static int | labelToCode(String value)
Converts the given value, which represents a date or time interval,
to its corresponding constant value.
|
Parameters: timestamp Timestamp object to be converted to a String representation formatStr template describing the desired format for the String
representation of timestamp
Returns: formatted String representation of timestamp
Throws: AxionException if format is invalid
See Also: DateTimeUtils
Parameters: timestamp Timestamp object to be converted to a String representation formatStr template describing the desired format for the String
representation of timestamp
timezone TimeZone to use in interpreting the value of
timestamp
to the desired String representation
Returns: formatted String representation of timestamp
Throws: AxionException if format is invalid
See Also: DateTimeUtils DateTimeUtils
Parameters: timestamp Timestamp object to be converted to a String representation formatStr template describing the desired format for the String
representation of timestamp
timezone TimeZone to use in interpreting the value of
timestamp
to the desired String representation locale Locale to use in resolving date components
Returns: formatted String representation of timestamp
Throws: AxionException if format is invalid
See Also: DateTimeUtils DateTimeUtils
Parameters: dateStr String representation of Timestamp to be returned formatStr template describing the format of dateStr
Returns: Timestamp containing date represented by dateStr
Throws: AxionException if format is invalid
See Also: DateTimeUtils DateTimeUtils
Parameters: dateStr String representation of Timestamp to be returned formatStr template describing the format of dateStr
timezone TimeZone to use in interpreting the value of dateStr
Returns: Timestamp containing date represented by dateStr
Throws: AxionException if format is invalid
See Also: DateTimeUtils
Parameters: dateStr String representation of Timestamp to be returned formatStr template describing the format of dateStr
timezone TimeZone to use in interpreting the value of dateStr
locale Locale to use in resolving date components
Returns: Timestamp containing date represented by dateStr
Throws: AxionException if format is invalid
See Also: DateTimeUtils DateTimeUtils
Parameters: t timestamp from which date/time element will be extracted partIdent date part to extract, e.g., 'yyyy', 'mm', etc.
Returns: String representation of extracted date/time element
Throws: AxionException if error occurs during extraction
See Also: DateTimeUtils
Parameters: t timestamp from which date/time element will be extracted partIdent date part to extract, e.g., 'yyyy', 'mm', etc. locale Locale to use in resolving date components
Returns: String representation of extracted date/time element
Throws: AxionException if error occurs during extraction
See Also: DateTimeUtils
Parameters: partCode
Returns:
Parameters: value String representation of date or time interval
Returns: constant value corresponding to value
Throws: AxionException if value
does not have a
corresponding constant.