java.lang.Object
org.emau.icmvc.ganimed.ttp.cm2.util.Dates

public class Dates extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ZoneId
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static LocalDate
    Returns the specified local date at the start of its day w.r.t. the system's default zone.
    static LocalDate
    Returns the specified date at the start of its day w.r.t. the system's default zone.
    static boolean
    Returns true if the specified local date refers to a day in the future w.r.t. the system's default zone.
    static boolean
    Returns true if the specified date refers to a day in the future w.r.t. the system's default zone.
    static Date
    toDate(LocalDate localDate)
    Converts the specified local date into a date w.r.t. the system's default zone.
    static LocalDate
    Returns a local date w.r.t. the system's default zone which refers to today.
    static LocalDate
    Converts the specified date into a local date w.r.t. the system's default zone.
    static LocalDate
    Returns a local date w.r.t. the system's default zone which refers to tomorrow.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SYSTEM_ZONE_ID

      public static final ZoneId SYSTEM_ZONE_ID
  • Constructor Details

    • Dates

      public Dates()
  • Method Details

    • atStartOfDay

      public static LocalDate atStartOfDay(Date date)
      Returns the specified date at the start of its day w.r.t. the system's default zone.
      Parameters:
      date - the instant to shift to the start of its day
      Returns:
      local date at the start of the day
    • atStartOfDay

      public static LocalDate atStartOfDay(LocalDate localDate)
      Returns the specified local date at the start of its day w.r.t. the system's default zone.
      Parameters:
      localDate - the local date to shift to the start of its day
      Returns:
      local date at the start of the day
    • today

      public static LocalDate today()
      Returns a local date w.r.t. the system's default zone which refers to today.
      Returns:
      a local date w.r.t. the system's default zone which refers to today
    • tomorrow

      public static LocalDate tomorrow()
      Returns a local date w.r.t. the system's default zone which refers to tomorrow.
      Returns:
      a local date w.r.t. the system's default zone which refers to tomorrow
    • toDate

      public static Date toDate(LocalDate localDate)
      Converts the specified local date into a date w.r.t. the system's default zone.
      Parameters:
      localDate - the local date to convert
      Returns:
      a date w.r.t. the system's default zone
    • toLocalDate

      public static LocalDate toLocalDate(Date date)
      Converts the specified date into a local date w.r.t. the system's default zone.
      Parameters:
      date - the date to convert
      Returns:
      a local date w.r.t. the system's default zone
    • isFutureDay

      public static boolean isFutureDay(Date date)
      Returns true if the specified date refers to a day in the future w.r.t. the system's default zone.
      Parameters:
      date - the date to check
      Returns:
      true if the specified date refers to a day in the future
    • isFutureDay

      public static boolean isFutureDay(LocalDate localDate)
      Returns true if the specified local date refers to a day in the future w.r.t. the system's default zone.
      Parameters:
      localDate - the local date to check
      Returns:
      true if the specified local date refers to a day in the future