php-dextrin

DXNLocalDateTime
in package
implements DXNValueInterface

FinalYes

DXN `local-datetime` (`@local-datetime "2026-10-20T14:30:00"`) -- a date and a time on the wall clock, with no offset, so no instant (DXN.md ยง1.3; Jan, 2026-10-20). Held as `.dxnb` holds it: nanoseconds since 1970-01-01T00:00:00 on the wall clock.

$localNanoseconds is a PHP integer, 64 bits: it reaches from 1677 to 2262, and a value outside that is refused (Nanos).

Table of Contents

Interfaces

DXNValueInterface
Implemented by every `DXN*` wrapper class -- the PHP analog of the `dxnType` string tag used for kind dispatch in the JS port, and of `Dextrin.Value`'s closed type union in the Elixir original. Native PHP values (`null`, `bool`, `int`, `float`, `string`, and `array` for `map`/`array`) never implement this; {@see Equality::kindOf()} handles those directly.

Constants

DXN_TYPE  : mixed = 'local-datetime'

Properties

$localNanoseconds  : int

Methods

__construct()  : mixed
compareTo()  : int
A total order against any other DXN value, not just another instance of this class -- backs {@see DXNSortedSet}. Cross-kind ordering is implementation-defined per DXN.md; within a kind, uses the kind's own natural order where one exists, or a deterministic structural fallback where it doesn't.
dxnType()  : string
The DXN type name this value represents, e.g. "symbol", "uuid".
equals()  : bool
Structural equality, recursing into nested DXN values as needed.
fromDateTimeImmutable()  : self
`$date`'s wall clock, its zone dropped.
toDateTimeImmutable()  : DateTimeImmutable
This wall-clock time in `$zone` (UTC when none is given), to the microsecond -- a local date-time names no zone of its own, so the caller picks one.

Constants

Properties

Methods

__construct()

public __construct(int $localNanoseconds) : mixed
Parameters
$localNanoseconds : int

compareTo()

A total order against any other DXN value, not just another instance of this class -- backs {@see DXNSortedSet}. Cross-kind ordering is implementation-defined per DXN.md; within a kind, uses the kind's own natural order where one exists, or a deterministic structural fallback where it doesn't.

public compareTo(mixed $other) : int
Parameters
$other : mixed
Return values
int

dxnType()

The DXN type name this value represents, e.g. "symbol", "uuid".

public dxnType() : string
Return values
string

equals()

Structural equality, recursing into nested DXN values as needed.

public equals(mixed $other) : bool
Parameters
$other : mixed
Return values
bool

fromDateTimeImmutable()

`$date`'s wall clock, its zone dropped.

public static fromDateTimeImmutable(DateTimeImmutable $date) : self
Parameters
$date : DateTimeImmutable
Tags
throws
InvalidArgumentException

outside the range 64 bits hold.

Return values
self

toDateTimeImmutable()

This wall-clock time in `$zone` (UTC when none is given), to the microsecond -- a local date-time names no zone of its own, so the caller picks one.

public toDateTimeImmutable([DateTimeZone|null $zone = null ]) : DateTimeImmutable
Parameters
$zone : DateTimeZone|null = null
Tags
throws
RuntimeException

when PHP cannot build it.

Return values
DateTimeImmutable
On this page

Search results