public class DateUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Calendar |
createCalendar(java.util.Date date,
LocalizationContext context) |
static java.sql.Date |
createDate(int year,
int month,
int day,
LocalizationContext context) |
static java.util.Date |
createDateTime(int year,
int month,
int day,
int hour,
int minute,
int second,
LocalizationContext context) |
static java.sql.Time |
createTime(int hour,
int minute,
int second,
LocalizationContext context) |
static java.math.BigDecimal |
normalizeDate(java.math.BigDecimal fromSerialDate,
Type toType) |
static java.util.Date |
normalizeDate(java.util.Date fromDate,
Type toType)
Converts a
Date value according to the requested Type to the proper Date
subclasses (java.sql.Time , java.sql.Date ) if needed. |
static java.util.Date |
normalizeDate(java.util.Date fromDate,
Type toType,
boolean convertSerial) |
static java.util.Date |
now(LocalizationContext context) |
public static java.util.Date normalizeDate(java.util.Date fromDate, Type toType)
Date
value according to the requested Type
to the proper Date
subclasses (java.sql.Time
, java.sql.Date
) if needed. If the requested type is unknown, no
conversion takes place and the input date is returned.fromDate
- The date to convert.toType
- The requested type of date.public static java.util.Date normalizeDate(java.util.Date fromDate, Type toType, boolean convertSerial)
public static java.math.BigDecimal normalizeDate(java.math.BigDecimal fromSerialDate, Type toType)
public static java.util.Date now(LocalizationContext context)
public static java.util.Date createDateTime(int year, int month, int day, int hour, int minute, int second, LocalizationContext context)
public static java.sql.Time createTime(int hour, int minute, int second, LocalizationContext context)
public static java.sql.Date createDate(int year, int month, int day, LocalizationContext context)
public static java.util.Calendar createCalendar(java.util.Date date, LocalizationContext context)