public class DateFormatUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
dateToOracleStr(Timestamp ts)
Contains some Oracle specific fixes to the timestamp.
|
static String |
dateToStr(Date date)
Formats a Date into a date string.
|
static String |
dateToUTCStr(Date UTCDate)
Turns a UTCTime in a java.util.Date object into a String object.
|
static boolean |
isLongDate(Timestamp date)
Tells whether Timestamp is in long format: with hours, minutes and
seconds fields.
|
static boolean |
isValidDate(String text)
Tells whether date/time string is in the format "dd/MM/yyyy".
|
static Timestamp |
nativeStrToTimestamp(String text)
Parse a native date/time string.
|
static Timestamp |
strToTimestamp(String text)
Parse a date/time string.
|
static String |
timeToStr(Date date)
Formats a Date into a time string.
|
static Date |
utcStrToDate(String UTCTime)
Turns a UTCTime in string format into a java.util.Date object
|
public static boolean isLongDate(Timestamp date)
date
- the time value to be testedpublic static boolean isValidDate(String text) throws ParseException
text
- the date/time string to be testedParseException
public static String timeToStr(Date date)
date
- the time value to be formatted into a time string.public static String dateToStr(Date date)
date
- the time value to be formatted into a date string.public static Timestamp strToTimestamp(String text) throws ParseException
text
- The date/time string to be parsedParseException
- If the given string cannot be parsed as a datepublic static Timestamp nativeStrToTimestamp(String text) throws ParseException
text
- The date/time string to be parsedParseException
- If the given string cannot be parsed as a datepublic static String dateToUTCStr(Date UTCDate) throws ParseException
UTCDate
- Date with a UTCTime dateParseException
public static Date utcStrToDate(String UTCTime) throws ParseException
UTCTime
- String with a UTCTime dateParseException
Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.