public class FlexDateTimeUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FlexDateTimeUtils.DateTimeComponent |
static class |
FlexDateTimeUtils.Day |
static class |
FlexDateTimeUtils.Month |
Constructor and Description |
---|
FlexDateTimeUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addDays(java.util.Date pDate,
int pDays,
java.util.TimeZone pTimeZone) |
static void |
addHours(java.util.Date pDate,
int pHours,
java.util.TimeZone pTimeZone) |
static void |
addMilliSeconds(java.util.Date pDate,
int pMilliSec,
java.util.TimeZone pTimeZone) |
static void |
addMinutes(java.util.Date pDate,
int pMinutes,
java.util.TimeZone pTimeZone) |
static void |
addMonths(java.util.Date pDate,
int pMonths,
java.util.TimeZone pTimeZone) |
static void |
addValue(java.util.Date pDate,
FlexDateTimeUtils.DateTimeComponent pType,
int pAmount,
java.util.TimeZone pTimeZone)
add value using GregorianCalendar.
|
static void |
addWeeks(java.util.Date pDate,
int pWeeks,
java.util.TimeZone pTimeZone) |
static void |
addYears(java.util.Date pDate,
int pYears,
java.util.TimeZone pTimeZone) |
static java.lang.String |
calendarToString(java.util.Calendar pCal,
java.lang.String pFormat) |
static java.util.Date |
currentUtilDate() |
static javax.xml.datatype.XMLGregorianCalendar |
currentXMLGregorianCalendar() |
static java.lang.String |
dateToString(java.util.Date pDate,
java.lang.String pFormat,
java.util.TimeZone pTimeZone)
Date to string conversion must use Timezone.
|
static java.lang.String |
dateToString(javax.xml.datatype.XMLGregorianCalendar pXCal,
java.lang.String pFormat,
java.util.TimeZone pTimeZone) |
static long |
diff(java.util.Date pFirstDate,
java.util.Date pSecondDate,
java.util.concurrent.TimeUnit pTimeUnit)
Difference in specified TimeUnit.
|
static int |
getDate(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static FlexDateTimeUtils.Day |
getDayOfWeek(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static int |
getHour12(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static int |
getHour24(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static int |
getMinutes(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static FlexDateTimeUtils.Month |
getMonth(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static int |
getValue(java.util.Date pDate,
FlexDateTimeUtils.DateTimeComponent pType,
java.util.TimeZone pTimeZone)
get value using GregorianCalendar.
|
static int |
getWeekOfMonth(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static int |
getYear(java.util.Date pDate,
java.util.TimeZone pTimeZone) |
static boolean |
inFuture(java.util.Date pDate) |
static boolean |
inPast(java.util.Date pDate) |
static void |
setDate(java.util.Date pDate,
int pValue,
java.util.TimeZone pTimeZone) |
static void |
setHour12(java.util.Date pDate,
int pValue,
java.util.TimeZone pTimeZone) |
static void |
setHour24(java.util.Date pDate,
int pValue,
java.util.TimeZone pTimeZone) |
static void |
setMinute(java.util.Date pDate,
int pValue,
java.util.TimeZone pTimeZone) |
static void |
setMonth(java.util.Date pDate,
FlexDateTimeUtils.Month pValue,
java.util.TimeZone pTimeZone) |
static void |
setValue(java.util.Date pDate,
FlexDateTimeUtils.DateTimeComponent pType,
int pValue,
java.util.TimeZone pTimeZone)
Set value using GregorianCalendar.
|
static void |
setYear(java.util.Date pDate,
int pValue,
java.util.TimeZone pTimeZone) |
static java.util.Calendar |
stringToCalendar(java.lang.String pDate,
java.lang.String pFormat,
java.util.TimeZone pTimeZone) |
static java.util.Date |
stringToDate(java.lang.String pDate,
java.lang.String pFormat,
java.util.TimeZone pTimeZone)
supplied timezone must be for provided String representation of date.
|
static java.util.Date |
toUtilDate(javax.xml.datatype.XMLGregorianCalendar pXCal)
xml gregorian calendar to util date
|
static javax.xml.datatype.XMLGregorianCalendar |
toXMLGregorianCalendar(java.util.Date pDate)
util date to XML gregorian calendar
|
public static java.util.Date currentUtilDate()
public static boolean inFuture(java.util.Date pDate)
public static boolean inPast(java.util.Date pDate)
public static int getValue(java.util.Date pDate, FlexDateTimeUtils.DateTimeComponent pType, java.util.TimeZone pTimeZone)
pDate
- pType
- pTimeZone
- public static void addValue(java.util.Date pDate, FlexDateTimeUtils.DateTimeComponent pType, int pAmount, java.util.TimeZone pTimeZone)
pDate
- pType
- pAmount
- pTimeZone
- public static void setValue(java.util.Date pDate, FlexDateTimeUtils.DateTimeComponent pType, int pValue, java.util.TimeZone pTimeZone)
pDate
- pType
- pValue
- pTimeZone
- public static javax.xml.datatype.XMLGregorianCalendar toXMLGregorianCalendar(java.util.Date pDate)
pDate
- public static java.util.Date toUtilDate(javax.xml.datatype.XMLGregorianCalendar pXCal)
pXCal
- public static javax.xml.datatype.XMLGregorianCalendar currentXMLGregorianCalendar()
public static java.lang.String dateToString(javax.xml.datatype.XMLGregorianCalendar pXCal, java.lang.String pFormat, java.util.TimeZone pTimeZone)
public static java.lang.String dateToString(java.util.Date pDate, java.lang.String pFormat, java.util.TimeZone pTimeZone)
pDate
- pFormat
- pTimeZone
- public static java.util.Date stringToDate(java.lang.String pDate, java.lang.String pFormat, java.util.TimeZone pTimeZone)
pDate
- pFormat
- pTimeZone
- public static java.util.Calendar stringToCalendar(java.lang.String pDate, java.lang.String pFormat, java.util.TimeZone pTimeZone)
public static java.lang.String calendarToString(java.util.Calendar pCal, java.lang.String pFormat)
public static long diff(java.util.Date pFirstDate, java.util.Date pSecondDate, java.util.concurrent.TimeUnit pTimeUnit)
pFirstDate
- pSecondDate
- pTimeUnit
- public static int getYear(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void addYears(java.util.Date pDate, int pYears, java.util.TimeZone pTimeZone)
public static void setYear(java.util.Date pDate, int pValue, java.util.TimeZone pTimeZone)
public static FlexDateTimeUtils.Month getMonth(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void addMonths(java.util.Date pDate, int pMonths, java.util.TimeZone pTimeZone)
public static void setMonth(java.util.Date pDate, FlexDateTimeUtils.Month pValue, java.util.TimeZone pTimeZone)
public static int getDate(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void setDate(java.util.Date pDate, int pValue, java.util.TimeZone pTimeZone)
public static FlexDateTimeUtils.Day getDayOfWeek(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void addDays(java.util.Date pDate, int pDays, java.util.TimeZone pTimeZone)
public static int getWeekOfMonth(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void addWeeks(java.util.Date pDate, int pWeeks, java.util.TimeZone pTimeZone)
public static int getHour24(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static int getHour12(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void addHours(java.util.Date pDate, int pHours, java.util.TimeZone pTimeZone)
public static void setHour24(java.util.Date pDate, int pValue, java.util.TimeZone pTimeZone)
public static void setHour12(java.util.Date pDate, int pValue, java.util.TimeZone pTimeZone)
public static int getMinutes(java.util.Date pDate, java.util.TimeZone pTimeZone)
public static void addMinutes(java.util.Date pDate, int pMinutes, java.util.TimeZone pTimeZone)
public static void setMinute(java.util.Date pDate, int pValue, java.util.TimeZone pTimeZone)
public static void addMilliSeconds(java.util.Date pDate, int pMilliSec, java.util.TimeZone pTimeZone)