Class PythonTimeComponents

java.lang.Object
io.deephaven.integrations.python.PythonTimeComponents

@ScriptApi public class PythonTimeComponents extends Object
Utility functions for time.py to extract java.time components in a single call.
  • Constructor Details

    • PythonTimeComponents

      public PythonTimeComponents()
  • Method Details

    • getLocalTimeComponents

      @ScriptApi public static int[] getLocalTimeComponents(LocalTime dt)
      Extracts the components from a LocalTime. Equivalent to new int[] {dt.getHour(), dt.getMinute(), dt.getSecond(), dt.getNano()}.
      Parameters:
      dt - the local time
      Returns:
      the components
    • getLocalTimeComponents

      @ScriptApi public static int[] getLocalTimeComponents(ZonedDateTime dt)
      Extracts the local time components from a ZonedDateTime. Equivalent to getComponents(dt.toLocalTime()).
      Parameters:
      dt - the zoned date time
      Returns:
      the components
      See Also:
    • getInstantComponents

      @ScriptApi public static long[] getInstantComponents(Instant dt)
      Extracts the components from an Instant. Equivalent to new long[] {dt.getEpochSecond(), dt.getNano()}.
      Parameters:
      dt - the instant
      Returns:
      the components
    • getInstantComponents

      @ScriptApi public static long[] getInstantComponents(ZonedDateTime dt)
      Extracts the Instant components from a ZonedDateTime. Equivalent to getComponents(dt.toInstant()).
      Parameters:
      dt - the zoned date time
      Returns:
      the components
      See Also:
    • getDurationComponents

      @ScriptApi public static long[] getDurationComponents(Duration dt)
      Extracts the components from a Duration. Equivalent to new long[] {dt.getSeconds(), dt.getNano()}.
      Parameters:
      dt - the duration
      Returns:
      the components
    • getPeriodComponents

      @ScriptApi public static int[] getPeriodComponents(Period dt)
      Extracts the components from a Period. Equivalent to new int[] {dt.getYears(), dt.getMonths(), dt.getDays()}.
      Parameters:
      dt - the period
      Returns:
      the components
    • getLocalDateComponents

      @ScriptApi public static int[] getLocalDateComponents(LocalDate dt)
      Extracts the components from a LocalDate. Equivalent to new int[] {dt.getYear(), dt.getMonthValue(), dt.getDayOfMonth()}.
      Parameters:
      dt - the local date
      Returns:
      the components
    • getLocalDateComponents

      @ScriptApi public static int[] getLocalDateComponents(ZonedDateTime dt)
      Extracts the LocalDate components from a ZonedDateTime. Equivalent to getComponents(dt.toLocalDate()).
      Parameters:
      dt - the zoned date time
      Returns:
      the components
      See Also: