works.iterative.core

Members list

Type members

Classlikes

object Moment extends MomentPlatform

Attributes

Supertypes
class Object
trait Matchable
class Any
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 Object
trait Matchable
class Any
Known subtypes
object Moment

Types

opaque type Moment

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.

Attributes