Package com.norconex.commons.lang.time

# Class DateUtil

java.lang.Object
com.norconex.commons.lang.time.DateUtil

@Deprecated(since="3.0.0") public final class DateUtil extends Object
Deprecated.
Use more flexible `DateModel` instead.
Date-related utility methods.

Since:
  2.0.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Date`
  `toDate(Instant instant)`
  Deprecated.
  Converts an `Instant` to a `Date` using the system default `ZoneId`.
  `static Date`
  `toDate(Instant instant, ZoneId zoneId)`
  Deprecated.
  Converts an `Instant` to a `Date` using the specified `ZoneId`.
  `static Date`
  `toDate(LocalDate date)`
  Deprecated.
  Converts a `LocalDate` to a `Date` using the system default `ZoneId`.
  `static Date`
  `toDate(LocalDate date, ZoneId zoneId)`
  Deprecated.
  Converts a `LocalDate` to a `Date` using the specified `ZoneId`.
  `static Date`
  `toDate(LocalDateTime date)`
  Deprecated.
  Converts a `LocalDateTime` to a `Date` using the system default `ZoneId`.
  `static Date`
  `toDate(LocalDateTime date, ZoneId zoneId)`
  Deprecated.
  Converts a `LocalDateTime` to a `Date` using the specified `ZoneId`.
  `static Date`
  `toDateUTC(Instant instant)`
  Deprecated.
  Converts an `Instant` to a `Date` using `ZoneOffset.UTC` (Greenwich).
  `static Date`
  `toDateUTC(LocalDate date)`
  Deprecated.
  Converts a `LocalDate` to a `Date` using `ZoneOffset.UTC` (Greenwich).
  `static Date`
  `toDateUTC(LocalDateTime date)`
  Deprecated.
  Converts a `LocalDateTime` to a `Date` using `ZoneOffset.UTC` (Greenwich).
  `static LocalDate`
  `toLocalDate(long date)`
  Deprecated.
  Converts a millisecond EPOCH date to a `LocalDate`, local to the system default `ZoneId`.
  `static LocalDate`
  `toLocalDate(long date, ZoneId zoneId)`
  Deprecated.
  Converts a millisecond EPOCH date to a `LocalDate`, local to the specified `ZoneId`.
  `static LocalDate`
  `toLocalDate(Date date)`
  Deprecated.
  Converts a `Date` to a `LocalDate`, local to the system default `ZoneId`.
  `static LocalDate`
  `toLocalDate(Date date, ZoneId zoneId)`
  Deprecated.
  Converts a `Date` to a `LocalDate`, local to the specified `ZoneId`.
  `static LocalDateTime`
  `toLocalDateTime(long date)`
  Deprecated.
  Converts a millisecond EPOCH date to a `LocalDateTime`, local to the system default `ZoneId`.
  `static LocalDateTime`
  `toLocalDateTime(long date, ZoneId zoneId)`
  Deprecated.
  Converts a millisecond EPOCH date to a `LocalDateTime`, local to the specified `ZoneId`.
  `static LocalDateTime`
  `toLocalDateTime(Date date)`
  Deprecated.
  Converts a `Date` to a `LocalDateTime`, local to the system default `ZoneId`.
  `static LocalDateTime`
  `toLocalDateTime(Date date, ZoneId zoneId)`
  Deprecated.
  Converts a `Date` to a `LocalDateTime`, local to the specified `ZoneId`.
  `static LocalDateTime`
  `toLocalDateTimeUTC(long date)`
  Deprecated.
  Converts a millisecond EPOCH date to a `LocalDateTime`, local to `ZoneOffset.UTC` (Greenwich).
  `static LocalDateTime`
  `toLocalDateTimeUTC(Date date)`
  Deprecated.
  Converts a `Date` to a `LocalDateTime`, local to `ZoneOffset.UTC` (Greenwich).
  `static LocalDate`
  `toLocalDateUTC(long date)`
  Deprecated.
  Converts a millisecond EPOCH date to a `LocalDate`, local to `ZoneOffset.UTC` (Greenwich).
  `static LocalDate`
  `toLocalDateUTC(Date date)`
  Deprecated.
  Converts a `Date` to a `LocalDate`, local to `ZoneOffset.UTC` (Greenwich).

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

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

- ## Method Details

  - ### toLocalDate

    public static LocalDate toLocalDate(Date date)
    Deprecated.
    Converts a `Date` to a `LocalDate`, local to the system default `ZoneId`.
    Parameters:
      `date` - to convert
    Returns:
      converted date

  - ### toLocalDate

    public static LocalDate toLocalDate(Date date, ZoneId zoneId)
    Deprecated.
    Converts a `Date` to a `LocalDate`, local to the specified `ZoneId`.
    Parameters:
      `date` - to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toLocalDateUTC

    public static LocalDate toLocalDateUTC(Date date)
    Deprecated.
    Converts a `Date` to a `LocalDate`, local to `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `date` - to convert
    Returns:
      converted date
    Since:
      3.0.0

  - ### toLocalDate

    public static LocalDate toLocalDate(long date)
    Deprecated.
    Converts a millisecond EPOCH date to a `LocalDate`, local to the system default `ZoneId`.
    Parameters:
      `date` - to convert
    Returns:
      converted date

  - ### toLocalDate

    public static LocalDate toLocalDate(long date, ZoneId zoneId)
    Deprecated.
    Converts a millisecond EPOCH date to a `LocalDate`, local to the specified `ZoneId`.
    Parameters:
      `date` - to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toLocalDateUTC

    public static LocalDate toLocalDateUTC(long date)
    Deprecated.
    Converts a millisecond EPOCH date to a `LocalDate`, local to `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `date` - to convert
    Returns:
      converted date
    Since:
      3.0.0

  - ### toLocalDateTime

    public static LocalDateTime toLocalDateTime(Date date)
    Deprecated.
    Converts a `Date` to a `LocalDateTime`, local to the system default `ZoneId`.
    Parameters:
      `date` - to convert
    Returns:
      converted date

  - ### toLocalDateTime

    public static LocalDateTime toLocalDateTime(Date date, ZoneId zoneId)
    Deprecated.
    Converts a `Date` to a `LocalDateTime`, local to the specified `ZoneId`.
    Parameters:
      `date` - to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toLocalDateTimeUTC

    public static LocalDateTime toLocalDateTimeUTC(Date date)
    Deprecated.
    Converts a `Date` to a `LocalDateTime`, local to `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `date` - to convert
    Returns:
      converted date
    Since:
      3.0.0

  - ### toLocalDateTime

    public static LocalDateTime toLocalDateTime(long date)
    Deprecated.
    Converts a millisecond EPOCH date to a `LocalDateTime`, local to the system default `ZoneId`.
    Parameters:
      `date` - to convert
    Returns:
      converted date

  - ### toLocalDateTime

    public static LocalDateTime toLocalDateTime(long date, ZoneId zoneId)
    Deprecated.
    Converts a millisecond EPOCH date to a `LocalDateTime`, local to the specified `ZoneId`.
    Parameters:
      `date` - to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toLocalDateTimeUTC

    public static LocalDateTime toLocalDateTimeUTC(long date)
    Deprecated.
    Converts a millisecond EPOCH date to a `LocalDateTime`, local to `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `date` - to convert
    Returns:
      converted date
    Since:
      3.0.0

  - ### toDate

    public static Date toDate(LocalDate date)
    Deprecated.
    Converts a `LocalDate` to a `Date` using the system default `ZoneId`.
    Parameters:
      `date` - to convert
    Returns:
      converted date

  - ### toDate

    public static Date toDate(LocalDate date, ZoneId zoneId)
    Deprecated.
    Converts a `LocalDate` to a `Date` using the specified `ZoneId`.
    Parameters:
      `date` - date to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toDateUTC

    public static Date toDateUTC(LocalDate date)
    Deprecated.
    Converts a `LocalDate` to a `Date` using `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `date` - to convert
    Returns:
      converted date
    Since:
      3.0.0

  - ### toDate

    public static Date toDate(LocalDateTime date)
    Deprecated.
    Converts a `LocalDateTime` to a `Date` using the system default `ZoneId`.
    Parameters:
      `date` - to convert
    Returns:
      converted date

  - ### toDate

    public static Date toDate(LocalDateTime date, ZoneId zoneId)
    Deprecated.
    Converts a `LocalDateTime` to a `Date` using the specified `ZoneId`.
    Parameters:
      `date` - date to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toDateUTC

    public static Date toDateUTC(LocalDateTime date)
    Deprecated.
    Converts a `LocalDateTime` to a `Date` using `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `date` - to convert
    Returns:
      converted date
    Since:
      3.0.0

  - ### toDate

    public static Date toDate(Instant instant)
    Deprecated.
    Converts an `Instant` to a `Date` using the system default `ZoneId`.
    Parameters:
      `instant` - to convert
    Returns:
      converted date

  - ### toDate

    public static Date toDate(Instant instant, ZoneId zoneId)
    Deprecated.
    Converts an `Instant` to a `Date` using the specified `ZoneId`.
    Parameters:
      `instant` - date to convert
      `zoneId` - zone id
    Returns:
      converted date

  - ### toDateUTC

    public static Date toDateUTC(Instant instant)
    Deprecated.
    Converts an `Instant` to a `Date` using `ZoneOffset.UTC` (Greenwich).
    Parameters:
      `instant` - to convert
    Returns:
      converted date
    Since:
      3.0.0