|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.axiondb.util.DateTimeUtils
public final class DateTimeUtils
Methods to support manipulation and conversion of date, time and timestamp values.
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 |
Constructor Summary | |
---|---|
DateTimeUtils()
|
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 timezone. |
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 timezone, 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 timezone, 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 timezone. |
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 timezone. |
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 timezone, 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MILLISECOND
public static final int SECOND
public static final int MINUTE
public static final int HOUR
public static final int DAY
public static final int WEEK
public static final int MONTH
public static final int QUARTER
public static final int YEAR
Constructor Detail |
---|
public DateTimeUtils()
Method Detail |
---|
public static String convertToChar(Timestamp timestamp, String formatStr) throws AxionException
timestamp
- Timestamp object to be converted to a String representationformatStr
- template describing the desired format for the String
representation of timestamp
timestamp
AxionException
- if format is invalidconvertToChar(Timestamp, String, java.util.TimeZone)
public static String convertToChar(Timestamp timestamp, String formatStr, TimeZone timezone) throws AxionException
timestamp
- Timestamp object to be converted to a String representationformatStr
- 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
timestamp
AxionException
- if format is invalidconvertToChar(Timestamp, String)
,
convertToChar(Timestamp, String, TimeZone, Locale)
public static String convertToChar(Timestamp timestamp, String formatStr, TimeZone timezone, Locale locale) throws AxionException
timestamp
- Timestamp object to be converted to a String representationformatStr
- 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 representationlocale
- Locale to use in resolving date components
timestamp
AxionException
- if format is invalidconvertToChar(Timestamp, String)
,
convertToChar(Timestamp, String, TimeZone)
public static Timestamp convertToTimestamp(String dateStr, String formatStr) throws AxionException
dateStr
- String representation of Timestamp to be returnedformatStr
- template describing the format of dateStr
dateStr
AxionException
- if format is invalidconvertToTimestamp(String, String, java.util.TimeZone)
,
convertToTimestamp(String, String, java.util.TimeZone, java.util.Locale)
public static Timestamp convertToTimestamp(String dateStr, String formatStr, TimeZone timezone) throws AxionException
dateStr
- String representation of Timestamp to be returnedformatStr
- template describing the format of dateStr
timezone
- TimeZone to use in interpreseting the value of dateStr
dateStr
AxionException
- if format is invalidconvertToTimestamp(String, String)
,
convertToTimestamp(String, String, java.util.TimeZone, java.util.Locale)
public static Timestamp convertToTimestamp(String dateStr, String formatStr, TimeZone timezone, Locale locale) throws AxionException
dateStr
- String representation of Timestamp to be returnedformatStr
- template describing the format of dateStr
timezone
- TimeZone to use in interpreseting the value of dateStr
locale
- Locale to use in resolving date components
dateStr
AxionException
- if format is invalidconvertToTimestamp(String, String)
,
convertToTimestamp(String, String, java.util.TimeZone)
public static String getDatePart(Timestamp t, String partIdent) throws AxionException
t
- timestamp from which date/time element will be extractedpartIdent
- date part to extract, e.g., 'yyyy', 'mm', etc.
AxionException
- if error occurs during extractiongetDatePart(Timestamp, String, Locale)
public static String getDatePart(Timestamp t, String partIdent, Locale locale) throws AxionException
t
- timestamp from which date/time element will be extractedpartIdent
- date part to extract, e.g., 'yyyy', 'mm', etc.locale
- Locale to use in resolving date components
AxionException
- if error occurs during extractiongetDatePart(Timestamp, String)
public static int labelToCode(String value) throws AxionException
value
- String representation of date or time interval
value
AxionException
- if value
does not have a
corresponding constant.public static String getPartMnemonicFor(String partString) throws AxionException
partCode
-
AxionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |