|
||||||||||
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 String |
convertDateToString(Date date)
Return the UTC date and time in W3C format down to second (yyyy-MM-ddTHH:mmZ). |
static String |
convertDateToString(long timeStamp)
Return the UTC date and time in W3C format down to second (yyyy-MM-ddTHH:mmZ). |
static Timestamp |
convertDateToTimestamp(Date d)
Convert java.util.Date to java.sql.Timestamp |
static String |
formatDateCustom(Date d,
String format)
|
static String |
formatDateUTC(Calendar c)
|
static String |
formatDateUTC(Date d)
|
static Calendar |
getCalendar(String dateString)
Create a Calendar instance for UTC time zone using the specified date. |
static Calendar |
getCalendar(String dateString,
TimeZone tz)
Create a Calendar instance using the specified date and Time zone |
static TimeZone |
getTimeZone(String tzId)
|
static int |
hoursInDay(Calendar cal)
This function returns number of hour in a day when given a Calendar with appropriate TZ. |
static boolean |
isDSTChangeDay(Calendar cal)
Determine whether a specific date is on DST change day |
static void |
moveToEnd(Calendar cal,
TimeUnit endOfFlag)
Move the any date-time to the end of the duration. |
static Date |
parseDateUTC(String s)
|
static Date |
toDate(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 TimeZone getTimeZone(String tzId)
public static Date parseDateUTC(String s) throws ParseException
ParseException
public static String formatDateUTC(Date d) throws Exception
Exception
public static String formatDateCustom(Date d, String format) throws Exception
Exception
public static String formatDateUTC(Calendar c) throws Exception
Exception
public static int hoursInDay(Calendar cal)
cal:
- The date for which the number of hours is requested
public static boolean isDSTChangeDay(Calendar cal)
cal:
- Date to know if it is DST change day. Appropriate TZ is specified
public static void moveToEnd(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 Calendar getCalendar(String dateString, TimeZone tz) throws Exception
dateString
- tz
- : TimeZone
Exception
public static Calendar getCalendar(String dateString) throws Exception
dateString
-
Exception
public static Date toDate(Timestamp timestamp)
timestamp
- java.sql.Timestamp
public static Timestamp convertDateToTimestamp(Date d)
d
- java.util.Date
public static String convertDateToString(Date date)
public static String convertDateToString(long timeStamp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |