# `LocalDateTime`

A date and a clock time with no zone: `2026-10-25T09:30:00`.

Use it for a future appointment, where the clock time must hold even if a country changes its daylight saving rules. It isn't one moment until you give it a zone. For a moment, use [`Instant`](/docs/types/type-instant.md).

## Shape

| Field | Type | Required? |
|---|---|---|
| `date` | [`CalendarDate`](/docs/types/type-calendar-date.md) | Yes |
| `time` | [`LocalTime`](/docs/types/type-local-time.md) | Yes |

## Example

```jadpo
LocalDateTime { date: "2026-10-25" time: LocalTime { hour: 9 minute: 30 second: 0 } }
```

`text.parse(raw, as: LocalDateTime)` reads one from text that comes from outside. Text that isn't one at all fails `malformed`, such as `2026-10-25T01:30:00Z`, `2026-10-25 01:30:00` or `2026-10-25T24:00:00`.

## Good to know

- `temporal.resolve` turns one into an instant in a [`Zone`](/docs/types/type-zone.md).
- `==` tells you whether two are the same, and `<` and `list.sort_by` compare and sort them.

## In JSON

A string, in a request, a response or `json.write`:

```json
"2026-03-29T01:30:00"
"2026-10-25T01:30:00"
```

## Details

<details>
<summary>Text form, storage, how it is shown, and operations</summary>

`LocalDateTime` is in the group Time and calendar, and has been in Jadpo since 0.1.0.

### Text form

`text.from` writes one standard text form, the same form `text.parse` reads back: `2026-03-29T01:30:00` and `2026-10-25T01:30:00`.

### How it is stored

It is stored in one column named for the field, of type `timestamp`. `2026-10-25T01:30:00` is stored as `'2026-10-25 01:30:00.000000'::timestamp`.

### How it is shown to people

`text.format(value, locale:)` shows it to people in their locale. A call also gives `format:`.

With `locale: Locale.en_gb` and `format: TimeFormat.date_time_medium`:

| Value | Shown |
|---|---|
| `2026-03-29T01:30:00` | `29 Mar 2026, 01:30:00` |
| `2026-10-25T01:30:00` | `25 Oct 2026, 01:30:00` |

### Operations

It also takes `text.parse`, `text.from`, `text.format`, `json.read`, `json.write` and `==`. [How every standard type behaves](/docs/every-standard-type-meets-one-contract.md) says how they work.

</details>
