Class DateUtil
- java.lang.Object
-
- org.pentaho.reporting.libraries.formula.util.DateUtil
-
public class DateUtil extends java.lang.Object
- Author:
- Cedric Pronzato
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 aDate
value according to the requestedType
to the properDate
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)
-
-
-
Method Detail
-
normalizeDate
public static java.util.Date normalizeDate(java.util.Date fromDate, Type toType)
Converts aDate
value according to the requestedType
to the properDate
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.- Parameters:
fromDate
- The date to convert.toType
- The requested type of date.- Returns:
- The converted date.
-
normalizeDate
public static java.util.Date normalizeDate(java.util.Date fromDate, Type toType, boolean convertSerial)
-
normalizeDate
public static java.math.BigDecimal normalizeDate(java.math.BigDecimal fromSerialDate, Type toType)
-
now
public static java.util.Date now(LocalizationContext context)
-
createDateTime
public static java.util.Date createDateTime(int year, int month, int day, int hour, int minute, int second, LocalizationContext context)
-
createTime
public static java.sql.Time createTime(int hour, int minute, int second, LocalizationContext context)
-
createDate
public static java.sql.Date createDate(int year, int month, int day, LocalizationContext context)
-
createCalendar
public static java.util.Calendar createCalendar(java.util.Date date, LocalizationContext context)
-
-