|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.oozie.util.DateUtils
public class DateUtils
Constructor Summary | |
---|---|
DateUtils()
|
Method Summary | |
---|---|
static java.lang.String |
convertDateToString(java.util.Date date)
Return the UTC date and time in W3C format down to second (yyyy-MM-ddTHH:mm:ssZ). |
static java.sql.Timestamp |
convertDateToTimestamp(java.util.Date d)
Convert java.util.Date to java.sql.Timestamp |
static java.lang.String |
formatDateUTC(java.util.Calendar c)
|
static java.lang.String |
formatDateUTC(java.util.Date d)
|
static java.util.Calendar |
getCalendar(java.lang.String dateString)
Create a Calendar instance for UTC time zone using the specified date. |
static java.util.Calendar |
getCalendar(java.lang.String dateString,
java.util.TimeZone tz)
Create a Calendar instance using the specified date and Time zone |
static java.util.TimeZone |
getTimeZone(java.lang.String tzId)
|
static int |
hoursInDay(java.util.Calendar cal)
This function returns number of hour in a day when given a Calendar with appropriate TZ. |
static boolean |
isDSTChangeDay(java.util.Calendar cal)
Determine whether a specific date is on DST change day |
static void |
moveToEnd(java.util.Calendar cal,
TimeUnit endOfFlag)
Move the any date-time to the end of the duration. |
static java.util.Date |
parseDateUTC(java.lang.String s)
|
static java.util.Date |
toDate(java.sql.Timestamp timestamp)
Convert java.sql.Timestamp to java.util.Date |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateUtils()
Method Detail |
---|
public static java.util.TimeZone getTimeZone(java.lang.String tzId)
public static java.util.Date parseDateUTC(java.lang.String s) throws java.lang.Exception
java.lang.Exception
public static java.lang.String formatDateUTC(java.util.Date d) throws java.lang.Exception
java.lang.Exception
public static java.lang.String formatDateUTC(java.util.Calendar c) throws java.lang.Exception
java.lang.Exception
public static int hoursInDay(java.util.Calendar cal)
cal:
- The date for which the number of hours is requested
public static boolean isDSTChangeDay(java.util.Calendar cal)
cal:
- Date to know if it is DST change day. Appropriate TZ is specified
public static void moveToEnd(java.util.Calendar cal, TimeUnit endOfFlag)
cal
- : Date-time needs to be moved to the endendOfFlag
- : day (for end of day) or month (for end of month) or emptypublic static java.util.Calendar getCalendar(java.lang.String dateString, java.util.TimeZone tz) throws java.lang.Exception
dateString
- tz
- : TimeZone
java.lang.Exception
public static java.util.Calendar getCalendar(java.lang.String dateString) throws java.lang.Exception
dateString
-
java.lang.Exception
public static java.util.Date toDate(java.sql.Timestamp timestamp)
timestamp
- java.sql.Timestamp
public static java.sql.Timestamp convertDateToTimestamp(java.util.Date d)
d
- java.util.Date
public static java.lang.String convertDateToString(java.util.Date date)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |