| java.lang.Object org.axiondb.util.DateTimeUtils
DateTimeUtils | final public class DateTimeUtils (Code) | | Methods to support manipulation and conversion of date, time and timestamp
values.
version: $Revision: 1.11 $ $Date: 2005/12/20 18:32:42 $ author: Jonathan Giron author: Ahimanikya Satapathy |
Field Summary | |
final public static int | DAY | final public static int | HOUR | final public static int | MILLISECOND | final public static int | MINUTE | final public static int | MONTH | final public static int | QUARTER | final public static int | SECOND | final public static int | WEEK | final public static int | YEAR |
Method Summary | |
public 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. | public 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. | public 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. | public 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. | public 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. | public static Timestamp | convertToTimestamp(String dateStr, String formatStr, TimeZone timezone, Locale locale) | public static String | getDatePart(Timestamp t, String partIdent) Extracts the specified date/time element from the given Timestamp,
using the default Locale.
Parameters: t - timestamp from which date/time element will be extracted Parameters: partIdent - date part to extract, e.g., 'yyyy', 'mm', etc. | public static String | getDatePart(Timestamp t, String partIdent, Locale locale) Extracts the specified date/time element from the given Timestamp,
using the given Locale. | public static String | getPartMnemonicFor(String partString) | public static int | labelToCode(String value) Converts the given value, which represents a date or time interval,
to its corresponding constant value. | static String | processFormatString(String rawFormat) Converts the given Axion date format string into a format usable with
java.util.SimpleDateFormat. |
DAY | final public static int DAY(Code) | | Constant representing day interval
|
HOUR | final public static int HOUR(Code) | | Constant representing hour time interval
|
MILLISECOND | final public static int MILLISECOND(Code) | | Constant representing millisecond time interval
|
MINUTE | final public static int MINUTE(Code) | | Constant representing minute time interval
|
MONTH | final public static int MONTH(Code) | | Constant representing month interval
|
QUARTER | final public static int QUARTER(Code) | | Constant representing quarter interval
|
SECOND | final public static int SECOND(Code) | | Constant representing second time interval
|
WEEK | final public static int WEEK(Code) | | Constant representing week interval
|
YEAR | final public static int YEAR(Code) | | Constant representing year interval
|
convertToChar | public static String convertToChar(Timestamp timestamp, String formatStr) throws AxionException(Code) | | Creates a String representation of the given Timestamp object, using
the given format string as a template and the current Axion time zone.
Parameters: timestamp - Timestamp object to be converted to a String representation Parameters: formatStr - template describing the desired format for the Stringrepresentation of timestamp formatted String representation of timestamp throws: AxionException - if format is invalid See Also: DateTimeUtils.convertToChar(Timestamp,String,java.util.TimeZone) |
convertToChar | public static String convertToChar(Timestamp timestamp, String formatStr, TimeZone timezone, Locale locale) throws AxionException(Code) | | 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.
Parameters: timestamp - Timestamp object to be converted to a String representation Parameters: formatStr - template describing the desired format for the Stringrepresentation of timestamp Parameters: timezone - TimeZone to use in interpreting the value oftimestamp to the desired String representation Parameters: locale - Locale to use in resolving date components formatted String representation of timestamp throws: AxionException - if format is invalid See Also: DateTimeUtils.convertToChar(Timestamp,String) See Also: DateTimeUtils.convertToChar(Timestamp,String,TimeZone) |
getDatePart | public static String getDatePart(Timestamp t, String partIdent, Locale locale) throws AxionException(Code) | | Extracts the specified date/time element from the given Timestamp,
using the given Locale.
Parameters: t - timestamp from which date/time element will be extracted Parameters: partIdent - date part to extract, e.g., 'yyyy', 'mm', etc. Parameters: locale - Locale to use in resolving date components String representation of extracted date/time element throws: AxionException - if error occurs during extraction See Also: DateTimeUtils.getDatePart(Timestamp,String) |
labelToCode | public static int labelToCode(String value) throws AxionException(Code) | | Converts the given value, which represents a date or time interval,
to its corresponding constant value.
Parameters: value - String representation of date or time interval constant value corresponding to value throws: AxionException - if value does not have a corresponding constant. |
processFormatString | static String processFormatString(String rawFormat) throws AxionException(Code) | | Converts the given Axion date format string into a format usable with
java.util.SimpleDateFormat.
Parameters: rawFormat - format string using Axion date/time mnemonics format string using SimpleDateFormat date/time mnemonics throws: AxionException - if rawFormat could not be successfullyconverted to the appropriate SimpleDateFormat version |
|
|