Package org.eclipse.birt.core.data

# Class DateTimeUtil

java.lang.Object
org.eclipse.birt.core.data.DateTimeUtil

public class DateTimeUtil extends Object

## Constructor Summary

Constructors
Constructor
Description
`DateTimeUtil(com.ibm.icu.util.ULocale locale, com.ibm.icu.util.TimeZone timeZone)`

## Method Summary

Modifier and Type
Method
Description
`Date`
`addDay(Date date, int num)`
Add num days
`long`
`diffDay(Date d1, Date d2)`
Return difference in number of days
`long`
`diffHour(Date d1, Date d2)`
Return difference in number of hours
`long`
`diffMinute(Date d1, Date d2)`
Return difference in number of minutes
`int`
`diffMonth(Date d1, Date d2)`
Return difference in number of months
`int`
`diffQuarter(Date d1, Date d2)`
Return difference in number of quarters
`long`
`diffSecond(Date d1, Date d2)`
Return difference in number of seconds
`long`
`diffWeek(Date d1, Date d2)`
Return difference in number of weeks
`int`
`diffYear(Date d1, Date d2)`
Return difference in number of years
`int`
`month(Date d)`
Month of date/time value d.
`int`
`quarter(Date d)`
Quarter number (1 to 4) of date/time value d
`String`
`weekDay(Date d)`
Day the week.
`int`
`year(Date d)`
4-digit year number of date/time value d

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DateTimeUtil

public DateTimeUtil(com.ibm.icu.util.ULocale locale, com.ibm.icu.util.TimeZone timeZone)

## Method Details

### year

public int year(Date d)
4-digit year number of date/time value d

Parameters:
  `d` -
Returns:

### quarter

public int quarter(Date d)
Quarter number (1 to 4) of date/time value d

Parameters:
  `d` -
Returns:

### month

public int month(Date d)
Month of date/time value d. Return month number (1-12)

Parameters:
  `d` -
Returns:

### weekDay

public String weekDay(Date d)
Day the week. Return a number 1 (Sunday) to 7 (Saturday).

Parameters:
  `d` -
Returns:

### diffYear

public int diffYear(Date d1, Date d2)
Return difference in number of years

Parameters:
  `d1` -
  `d2` -
Returns:

### diffMonth

public int diffMonth(Date d1, Date d2)
Return difference in number of months

Parameters:
  `d1` -
  `d2` -
Returns:

### diffQuarter

public int diffQuarter(Date d1, Date d2)
Return difference in number of quarters

Parameters:
  `d1` -
  `d2` -
Returns:

### diffWeek

public long diffWeek(Date d1, Date d2)
Return difference in number of weeks

Parameters:
  `d1` -
  `d2` -
Returns:

### diffDay

public long diffDay(Date d1, Date d2)
Return difference in number of days

Parameters:
  `d1` -
  `d2` -
Returns:

### diffHour

public long diffHour(Date d1, Date d2)
Return difference in number of hours

Parameters:
  `d1` -
  `d2` -
Returns:

### diffMinute

public long diffMinute(Date d1, Date d2)
Return difference in number of minutes

Parameters:
  `d1` -
  `d2` -
Returns:

### diffSecond

public long diffSecond(Date d1, Date d2)
Return difference in number of seconds

Parameters:
  `d1` -
  `d2` -
Returns:

### addDay

public Date addDay(Date date, int num)
Add num days

Parameters:
  `date` -
  `num` -
Returns: