com.jaxfront.core.util
Class JAXFrontDateTools
java.lang.Object
com.jaxfront.core.util.JAXFrontDateTools
public class JAXFrontDateTools
- extends java.lang.Object
|
Method Summary |
static java.lang.String |
convertLocalized(java.lang.String pattern,
IUser user)
|
static java.lang.String |
convertSQLDateToIsoDate(java.lang.String dateStr)
|
static long |
difference(java.util.Date from,
java.util.Date to,
int mode)
|
static java.text.DateFormat |
evalIsoTimeFormatter(java.lang.String dateStr)
|
static int |
extractDateDelimiter(java.lang.String pattern,
char dateSymbol)
Extract a possible separator for the given date symbol to it's antecessor returns -1 if not found, otherwise the char int |
static java.lang.String |
formatDate(long number,
java.lang.String pattern)
Method format calls the java.text.DecimalFormat class with the given parameters. |
static java.lang.String |
formatLoginTime(java.util.Date loginTime,
java.lang.String language)
|
static java.lang.String |
formatTo(java.text.DateFormat currentFormat,
java.lang.String currentFormatedTime,
java.lang.String targetFormat)
|
static java.lang.String |
formatToISODate(java.text.DateFormat currentFormat,
java.lang.String currentFormatedDate)
|
static java.lang.String |
formatToISODate(java.lang.String pattern,
java.lang.String currentFormatedDate)
|
static java.lang.String |
formatToISODateTime(java.text.DateFormat currentFormat,
java.lang.String currentFormatedDateTime)
|
static java.lang.String |
formatToISODateTime(java.text.DateFormat currentFormat,
java.lang.String currentFormatedDateTime,
boolean hasReqEx)
|
static java.lang.String |
formatToISOTime(java.text.DateFormat currentFormat,
java.lang.String currentFormatedTime)
|
static java.lang.String |
getCurrentISODate()
|
static java.lang.String |
getCurrentISODateTime()
|
static java.lang.String |
getCurrentISODateTime(long time)
|
static java.lang.String |
getCurrentISOTime(long time)
|
static int |
getDateDelimiterFor(java.lang.String pattern,
char dateSymbol)
Extract a possible separator for the given date symbol to it's antecessor returns -1 if not found, 0 if found at index 0, otherwise the char int value of the separator |
static java.text.SimpleDateFormat |
getISODateFormatNotLenient()
|
static XSDDateFormat |
getISODateTimeFormatNotLenient()
|
static java.text.SimpleDateFormat |
getISOTimeFormatNotLenient()
|
static int |
getUsedISODateFormat(java.lang.String value)
|
static java.lang.String |
hardCoreIsoConverter(java.lang.String pattern,
java.lang.String value)
Extract a possible separator for the given date symbol to it's antecessor returns -1 if not found, otherwise the char int |
static boolean |
isISODate(java.lang.String currentFormat)
|
static boolean |
isISODateTime(java.lang.String currentFormat)
|
static boolean |
isISOTime(java.lang.String currentFormat)
|
static boolean |
isSQLDate(java.lang.String currentFormatedDate)
|
static java.util.Date |
parseISODate(java.lang.String dateStr)
|
static java.util.Date |
parseISOTime(java.lang.String timeStr)
|
static java.util.Date |
parseSQLDate(java.lang.String dateStr)
|
static java.lang.String |
toISODateTime(long time)
|
static java.lang.String |
toISODateTime(java.sql.Timestamp time)
|
static java.lang.String |
toSQLDate(long time)
|
static java.lang.String |
toSQLDateTime(long time)
|
static java.lang.String |
toSQLDateTimeShort(long time)
|
static java.lang.String |
toSQLTime(java.util.Date time)
|
static java.lang.String |
toSQLTime(long time)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DIFFERENCE_IN_DAYS
public static final int DIFFERENCE_IN_DAYS
- See Also:
- Constant Field Values
DIFFERENCE_IN_MS
public static final int DIFFERENCE_IN_MS
- See Also:
- Constant Field Values
ISO_DATE_PATTERN
public static final java.lang.String ISO_DATE_PATTERN
- See Also:
- Constant Field Values
ISO_DATE_TIME_PATTERN
public static final java.lang.String ISO_DATE_TIME_PATTERN
- See Also:
- Constant Field Values
ISO_TIME_PATTERN
public static final java.lang.String ISO_TIME_PATTERN
- See Also:
- Constant Field Values
ISO_TIME_SHORT_PATTERN
public static final java.lang.String ISO_TIME_SHORT_PATTERN
- See Also:
- Constant Field Values
isoDateFormat
public static java.text.SimpleDateFormat isoDateFormat
iSODateFormat
public static final int iSODateFormat
- See Also:
- Constant Field Values
isoDateFormatNotLenient
public static java.text.SimpleDateFormat isoDateFormatNotLenient
isoDateTimeFormat
public static XSDDateFormat isoDateTimeFormat
iSODateTimeFormat
public static final int iSODateTimeFormat
- See Also:
- Constant Field Values
isoDateTimeFormatNotLenient
public static XSDDateFormat isoDateTimeFormatNotLenient
iSONoFormat
public static final int iSONoFormat
- See Also:
- Constant Field Values
isoTimeFormat
public static java.text.SimpleDateFormat isoTimeFormat
iSOTimeFormat
public static final int iSOTimeFormat
- See Also:
- Constant Field Values
isoTimeFormatNotLenient
public static java.text.SimpleDateFormat isoTimeFormatNotLenient
isoTimeShortFormat
public static java.text.SimpleDateFormat isoTimeShortFormat
NLS_DATE_TIME_SHORT_PREFIX
public static final java.lang.String NLS_DATE_TIME_SHORT_PREFIX
- See Also:
- Constant Field Values
SQL_DATE_PATTERN
public static final java.lang.String SQL_DATE_PATTERN
- See Also:
- Constant Field Values
SQL_DATE_TIME_PATTERN
public static final java.lang.String SQL_DATE_TIME_PATTERN
- See Also:
- Constant Field Values
SQL_DATE_TIME_PATTERN_SHORT
public static final java.lang.String SQL_DATE_TIME_PATTERN_SHORT
- See Also:
- Constant Field Values
SQL_TIME_PATTERN
public static final java.lang.String SQL_TIME_PATTERN
- See Also:
- Constant Field Values
sqlDateFormat
public static java.text.SimpleDateFormat sqlDateFormat
sqlDateTIMEFormat
public static java.text.SimpleDateFormat sqlDateTIMEFormat
sqlDateTimeFormatShort
public static java.text.SimpleDateFormat sqlDateTimeFormatShort
sqlTIMEFormat
public static java.text.SimpleDateFormat sqlTIMEFormat
JAXFrontDateTools
public JAXFrontDateTools()
convertLocalized
public static java.lang.String convertLocalized(java.lang.String pattern,
IUser user)
convertSQLDateToIsoDate
public static java.lang.String convertSQLDateToIsoDate(java.lang.String dateStr)
difference
public static long difference(java.util.Date from,
java.util.Date to,
int mode)
evalIsoTimeFormatter
public static java.text.DateFormat evalIsoTimeFormatter(java.lang.String dateStr)
extractDateDelimiter
public static int extractDateDelimiter(java.lang.String pattern,
char dateSymbol)
- Extract a possible separator for the given date symbol to it's antecessor returns -1 if not found, otherwise the char int
- Parameters:
pattern - dateSymbol -
- Returns:
formatDate
public static java.lang.String formatDate(long number,
java.lang.String pattern)
- Method format calls the java.text.DecimalFormat class with the given parameters.
- Parameters:
number - pattern -
- Returns:
- String
formatLoginTime
public static java.lang.String formatLoginTime(java.util.Date loginTime,
java.lang.String language)
formatTo
public static java.lang.String formatTo(java.text.DateFormat currentFormat,
java.lang.String currentFormatedTime,
java.lang.String targetFormat)
throws java.text.ParseException
- Throws:
java.text.ParseException
formatToISODate
public static java.lang.String formatToISODate(java.text.DateFormat currentFormat,
java.lang.String currentFormatedDate)
throws java.text.ParseException
- Throws:
java.text.ParseException
formatToISODate
public static java.lang.String formatToISODate(java.lang.String pattern,
java.lang.String currentFormatedDate)
throws java.text.ParseException
- Throws:
java.text.ParseException
formatToISODateTime
public static java.lang.String formatToISODateTime(java.text.DateFormat currentFormat,
java.lang.String currentFormatedDateTime)
throws java.text.ParseException
- Throws:
java.text.ParseException
formatToISODateTime
public static java.lang.String formatToISODateTime(java.text.DateFormat currentFormat,
java.lang.String currentFormatedDateTime,
boolean hasReqEx)
throws java.text.ParseException
- Throws:
java.text.ParseException
formatToISOTime
public static java.lang.String formatToISOTime(java.text.DateFormat currentFormat,
java.lang.String currentFormatedTime)
throws java.text.ParseException
- Throws:
java.text.ParseException
getCurrentISODate
public static java.lang.String getCurrentISODate()
getCurrentISODateTime
public static java.lang.String getCurrentISODateTime()
getCurrentISODateTime
public static java.lang.String getCurrentISODateTime(long time)
getCurrentISOTime
public static java.lang.String getCurrentISOTime(long time)
getDateDelimiterFor
public static int getDateDelimiterFor(java.lang.String pattern,
char dateSymbol)
- Extract a possible separator for the given date symbol to it's antecessor returns -1 if not found, 0 if found at index 0, otherwise the char int value of the separator
- Parameters:
pattern - dateSymbol -
- Returns:
getISODateFormatNotLenient
public static java.text.SimpleDateFormat getISODateFormatNotLenient()
getISODateTimeFormatNotLenient
public static XSDDateFormat getISODateTimeFormatNotLenient()
getISOTimeFormatNotLenient
public static java.text.SimpleDateFormat getISOTimeFormatNotLenient()
getUsedISODateFormat
public static int getUsedISODateFormat(java.lang.String value)
hardCoreIsoConverter
public static java.lang.String hardCoreIsoConverter(java.lang.String pattern,
java.lang.String value)
- Extract a possible separator for the given date symbol to it's antecessor returns -1 if not found, otherwise the char int
- Parameters:
pattern - dateSymbol -
- Returns:
isISODate
public static boolean isISODate(java.lang.String currentFormat)
isISODateTime
public static boolean isISODateTime(java.lang.String currentFormat)
isISOTime
public static boolean isISOTime(java.lang.String currentFormat)
isSQLDate
public static boolean isSQLDate(java.lang.String currentFormatedDate)
parseISODate
public static java.util.Date parseISODate(java.lang.String dateStr)
parseISOTime
public static java.util.Date parseISOTime(java.lang.String timeStr)
parseSQLDate
public static java.util.Date parseSQLDate(java.lang.String dateStr)
toISODateTime
public static java.lang.String toISODateTime(long time)
toISODateTime
public static java.lang.String toISODateTime(java.sql.Timestamp time)
toSQLDate
public static java.lang.String toSQLDate(long time)
toSQLDateTime
public static java.lang.String toSQLDateTime(long time)
toSQLDateTimeShort
public static java.lang.String toSQLDateTimeShort(long time)
toSQLTime
public static java.lang.String toSQLTime(java.util.Date time)
toSQLTime
public static java.lang.String toSQLTime(long time)