# Class DateUtil (5.0.3)

    public final class DateUtil

A utility class that centralizes processing of dates.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> DateUtil

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### MILLISECONDS_IN_DAY

    public static final int MILLISECONDS_IN_DAY

The milliseconds in a day.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

## Static Methods

### deserializeDate(String date)

    public static Date deserializeDate(String date)

Converts a string containing the milliseconds since the UNIX Epoch into a Date.

Two formats of date string are supported: "yyyy-MM-dd" and a long. Eventually,
the "yyyy-MM-dd" format support will be removed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `date` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the date string to deserialize into a date |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Date.html` | a date |

### formatDateTime(Date date)

    public static String formatDateTime(Date date)

Formats a date according ISO 8601 full date time format. Currently,
this is used to print dates for error messages.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `date` | `https://docs.oracle.com/javase/8/docs/api/java/util/Date.html` the date to format as a string |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | a string representing the date in ISO 8601 format |

### getEpochPlusDays(int days, int milliseconds)

    public static final Date getEpochPlusDays(int days, int milliseconds)

Constructs a [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html) set to the UNIX Epoch plus days plus milliseconds.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `days` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the number of days to add to the UNIX Epoch to get a Date |
| `milliseconds` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the number of milliseconds to add to the date |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Date.html` | the Date with number of days plus Epoch |

### serializeDate(Date date)

    public static String serializeDate(Date date)

Converts date into a string containing the milliseconds since the UNIX Epoch.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `date` | `https://docs.oracle.com/javase/8/docs/api/java/util/Date.html` the date to serialize as a string |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | a string representing the date as milliseconds since the UNIX Epoch |