works.iterative.core
Members list
Type members
Classlikes
Attributes
- Supertypes
- Self type
-
Moment.type
JVM side of the Moment companion: the java.time engine behind parse/format, plus the java.time interop surface. Everything here is a companion member, so call sites need no import: m.toInstant and both Conversions resolve from Moment's implicit scope, Moment(instant) and Moment(ldt) are plain companion calls. Moment stays at millisecond precision, so sub-millisecond Instant precision truncates.
JVM side of the Moment companion: the java.time engine behind parse/format, plus the java.time interop surface. Everything here is a companion member, so call sites need no import: m.toInstant and both Conversions resolve from Moment's implicit scope, Moment(instant) and Moment(ldt) are plain companion calls. Moment stays at millisecond precision, so sub-millisecond Instant precision truncates.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object Moment
Types
A moment in time, represented as epoch milliseconds (UTC)
A moment in time, represented as epoch milliseconds (UTC)
Why not to use Instant by itself? Well, the time representation might change for some reason, or might be different in different contexts (Like ScalaJS or Native). Better to abstract it away.
The representation is an epoch-millisecond Long on every platform; parsing and formatting delegate to the platform engine (java.time on JVM, the Date built-ins on JS) behind a shared syntactic guard, so the platforms accept and reject the same inputs.