# std/time

Wall-clock time at the host boundary, and a pure calendar breakdown.

`now()` and `monotonic()` are host effects, so generators and comptime code cannot call them; the parity harness fixes the clock with `VYRN_FIXED_TIME`. The calendar breakdown and the formatters are pure. UTC only: no timezone database, no DST, no locale. Milliseconds since the Unix epoch, UTC. A distinct type, so a timestamp does not mix with a plain count.

## Instant

`type`, at line 10.

```vyrn
type Instant = Int64 where value >= 0
```

Milliseconds since the Unix epoch, UTC. A distinct type, so a timestamp does not mix with a plain count.

## Civil

`type`, at line 13.

```vyrn
type Civil = { year: Int64, month: Int64, day: Int64 }
```

A UTC calendar date, the pure breakdown of an `Instant`'s day component.

## now

`fn`, at line 23.

```vyrn
fn now() -> Instant
```

The current wall-clock instant.

## monotonic

`fn`, at line 29.

```vyrn
fn monotonic() -> Int64
```

Monotonic nanoseconds, for durations: `now()` jumps when the wall clock is set.

## toMillis

`fn`, at line 33.

```vyrn
fn toMillis(i: Instant) -> Int64
```

## fromMillis

`fn`, at line 38.

```vyrn
fn fromMillis(n: Int64) -> Instant
```

An instant from raw epoch milliseconds, validated non-negative.

## civil

`fn`, at line 59.

```vyrn
fn civil(i: Instant) -> Civil
```

The UTC calendar date (year/month/day) of an instant.

## year

`fn`, at line 64.

```vyrn
fn year(i: Instant) -> Int64
```

The UTC year of an instant.

## month

`fn`, at line 69.

```vyrn
fn month(i: Instant) -> Int64
```

The UTC month of an instant (1..12).

## day

`fn`, at line 74.

```vyrn
fn day(i: Instant) -> Int64
```

The UTC day-of-month of an instant (1..31).

## hour

`fn`, at line 79.

```vyrn
fn hour(i: Instant) -> Int64
```

The UTC hour of an instant (0..23).

## minute

`fn`, at line 85.

```vyrn
fn minute(i: Instant) -> Int64
```

The UTC minute of an instant (0..59).

## second

`fn`, at line 91.

```vyrn
fn second(i: Instant) -> Int64
```

The UTC second of an instant (0..59).

## format

`fn`, at line 118.

```vyrn
fn format(i: Instant) -> String
```

UTC timestamp `YYYY-MM-DD HH:MM:SS`.

## formatIso

`fn`, at line 126.

```vyrn
fn formatIso(i: Instant) -> String
```

ISO-8601 UTC timestamp `YYYY-MM-DDTHH:MM:SSZ`.

---

From https://vyrn-lang.github.io/docs/std/time.html — generated by `site/export.vyrn` from the Vyrn repository.
