PtcRunner.Lisp.Java.Time.Instant (PtcRunner v0.14.0)

Copy Markdown View Source

Native, bounded representation of java.time.Instant.

Instants retain Java's epoch-second plus nanosecond adjustment identity, so sub-microsecond precision is not lost to the host DateTime representation.

Summary

Types

t()

@type t() :: %PtcRunner.Lisp.Java.Time.Instant{
  epoch_second: integer(),
  nano: non_neg_integer()
}

Functions

after?(list)

@spec after?([t()]) :: {:ok, boolean()}

before?(list)

@spec before?([t()]) :: {:ok, boolean()}

canonical(instant)

@spec canonical(t()) :: String.t()

compare(left, right)

@spec compare(t(), t()) :: :lt | :eq | :gt

new(epoch_second, nano)

@spec new(integer(), integer()) :: {:ok, t()} | :error

parse(list)

@spec parse([String.t() | nil]) ::
  {:ok, t()} | {:error, PtcRunner.Lisp.Java.Condition.t()}

to_epoch_milli(list)

@spec to_epoch_milli([t()]) ::
  {:ok, PtcRunner.Lisp.Java.Primitive.t()}
  | {:error, PtcRunner.Lisp.Java.Condition.t()}

valid?(value)

@spec valid?(term()) :: boolean()