Skip to content

std:datetime/LocalDateTime

Canonical occurrence: protos/lib/datetime/LocalDateTime.protos · Protos revision: e99b712ecf658a527b1fe82c8beba2c1286d8dc9.

Local civil date-times: exactly a civil date from std:datetime/Date combined with a local time from std:datetime/Time. A local date-time is a frozen ordinary object with date and time slots holding those frozen values. It does not identify an instant and carries no offset, zone, or clock state.

Every local date-time’s immediate delegation parent is this module, the canonical local date-time factory and prototype. recognizes accepts exactly the local date-times of this family: objects whose immediate parent is this module, whose local slots are exactly the local date-time state and behavior slots, and whose components are a recognized date and time. Matching slots under another parent are not a local date-time.

Local date-times answer semantic equality through ==: two are equal when both are local date-times and their dates and their times are equal. hash is coherent with that equality, so independently constructed equal local date-times work as the same Map key. === remains ordinary object identity. compare is the natural order, dates first and then times, and answers 0 exactly for equal local date-times.

This page lists the complete mechanically observable top-level slot inventory required by D067. Authored documentation, when present, is canonical D062 prose; mechanical presence alone does not create a stability or compatibility promise.

Answers a fresh frozen local date-time composing date, a value recognized by std:datetime/Date, and time, a value recognized by std:datetime/Time. The components are stored as given. Any other argument signals an Error.

Answers -1, 0, or 1 as local date-time left is before, equal to, or after local date-time right, ordering by Date.compare of the dates and then Time.compare of the times. The result is 0 exactly when left == right. Arguments must be local date-times recognized by this module; otherwise an Error is signalled.

Answers true exactly when value is a local date-time of this family: its immediate delegation parent is this module, its local slots are exactly date, time, equals, ==, and hash, date is recognized by std:datetime/Date, and time is recognized by std:datetime/Time. Answers false for any other value.

Exact module source · Standard-library API · Standard library overview