Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Utc: parse ISO 8601 / RFC 3339, and format with fractions of a second

Chiusa
#533 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start by reading the Utc implementation and InternalDateTime calendar arithmetic; the issue names no source files or tests. Determine how parsing and formatting fit the existing API, then check how RFC 3339 offsets, optional fractions, and year 1 are represented. Done means round-trip parsing and nanosecond formatting cover the examples and offset cases, or the Utc documentation clearly states the limitation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Utc.to_iso_8601 formats an instant, but nothing parses one back, and the format drops fractions of a second.

What we needed while porting a Go service to 0.26.0-rc3: it keeps a ledger file of the droplets it created, written by Go with time.Time (RFC 3339 with nanoseconds, "2026-10-17T09:01:23.456789123Z", and "0001-01-01T00:00:00Z" for none). Reading it back in Roc means writing an RFC 3339 parser by hand. Times in JSON from other tools are the same: GitHub's published_at, systemd's timestamps, cloud APIs.

A sketch:

Utc.from_iso_8601 : Str -> Try(Utc, [InvalidTime(Str)])   # RFC 3339: Z or an offset, optional fraction
Utc.to_iso_8601_nanos : Utc -> Str                        # "2026-10-17T09:01:23.456789123Z"

The calendar arithmetic is already there (InternalDateTime), and Utc's signed range covers year 1. If it is out of scope for basic-cli, a line in Utc's docs saying so would also help.

Seen on 0.26.0-rc3.

Lingua principale
Rust
Stelle
122
Fork
47
Merge medio
11h 6m
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di roc-lang/basic-cli

Tutte le issue di roc-lang/basic-cli

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.