from_microseconds : I64 -> PosixBoundary
PosixBoundary
PosixBoundary :: # (opaque)
Exact POSIX coordinates: microseconds since 1970-01-01T00:00:00Z. Leap seconds are not representable on this axis.
Example
Use integer microseconds for exact coordinates, or explicitly select the rounding policy when accepting decimal seconds. Zero is the Unix epoch; this coordinate does not attach a display timezone.
import time.PosixBoundary
expect {
point = PosixBoundary.from_seconds(1.25, RejectSubmicrosecond)?
PosixBoundary.to_microseconds(point) == 1250000
}
Examples assume a package dependency named time.
to_microseconds : PosixBoundary -> I64
from_nanoseconds : I128 -> Try(PosixBoundary, [Submicrosecond, OutOfRange, ..])
from_nanoseconds_with_rounding : I128, Rounding -> Try(PosixBoundary, [Submicrosecond, OutOfRange, ..])
from_seconds : Dec, Rounding -> Try(PosixBoundary, [Submicrosecond, OutOfRange, ..])
compare : PosixBoundary, PosixBoundary -> [LT, EQ, GT]
to_inspect : PosixBoundary -> Str
difference : PosixBoundary, PosixBoundary -> Try(PosixDelta, [OutOfRange, ..])
Rounding : [RejectSubmicrosecond, Floor, Ceiling, TowardZero, NearestTiesEven]
Nearest rounding resolves exact ties to the even microsecond.