Class DateUtil
Helper class for work with Date values
Inherited Members
Namespace:
Assembly: .dll
Syntax
public final class DateUtil
Constructors
DateUtil()
Creates a new instance of DateUtil class
Declaration
public DateUtil()
Fields
DATE_MAX_TICKS_VALUE
Declaration
public static final long DATE_MAX_TICKS_VALUE
Field Value
| Type | Description |
|---|---|
| long |
DATE_MAX_VALUE
Declaration
public static final Date DATE_MAX_VALUE
Field Value
| Type | Description |
|---|---|
| Date |
DATE_MIN_TICKS_VALUE
Declaration
public static final long DATE_MIN_TICKS_VALUE
Field Value
| Type | Description |
|---|---|
| long |
DATE_MIN_VALUE
Declaration
public static final Date DATE_MIN_VALUE
Field Value
| Type | Description |
|---|---|
| Date |
Methods
addDelta(long current, long delta)
Adds the delta to specified value
Declaration
public long addDelta(long current, long delta)
Parameters
| Type | Name | Description |
|---|---|---|
| long | current | The current value |
| long | delta | The delta value |
Returns
| Type | Description |
|---|---|
| long | The new value |
isAdditionValid(long current, long delta)
Checks if addition is valid for specified value
Declaration
public boolean isAdditionValid(long current, long delta)
Parameters
| Type | Name | Description |
|---|---|---|
| long | current | The current value to add to |
| long | delta | The delta value to add |
Returns
| Type | Description |
|---|---|
| boolean | True if addition is valid for current value |
isDivisibleBy(long current, long dateInterval)
Checks if specified value is divisible by passed interval
Declaration
public boolean isDivisibleBy(long current, long dateInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| long | current | The value to check |
| long | dateInterval | The divider |
Returns
| Type | Description |
|---|---|
| boolean | True if value is divisible by date interval |
roundUp(long current, long dateInterval)
Rounds up specified value to date interval
Declaration
public long roundUp(long current, long dateInterval)
Parameters
| Type | Name | Description |
|---|---|---|
| long | current | The value to round up |
| long | dateInterval | The date interval for rounding operation |
Returns
| Type | Description |
|---|---|
| long | The rounded value |