Utc: parse ISO 8601 / RFC 3339, and format with fractions of a second
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Rust
- 星號
- 122
- 分支
- 47
- 平均合併
- 11 小時 6 分鐘
- 30 天內合併 PR
- 21
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
roc-lang/basic-cli 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 45/100
roc-lang/basic-cli#500 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 25/100
roc-lang/basic-cli#482 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 45/100
維護者通常 1 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 45/100
roc-lang/basic-cli#455 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 32/100
維護者通常 1 天內回覆
查看 roc-lang/basic-cli 的全部 Issue
相似的 Issue
-
good first issue help wanted r-feature
難度 2/5 1-3 小時 新手友好度 82/100
servo/rust-smallvec#792 ·
維護者通常 1 天內回覆
-
A-Unicode C-bug P-low
難度 2/5 1-3 小時 新手友好度 70/100
rust-lang/rustfmt#7210 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
area:sim good first issue kind:feature
難度 2/5 1-3 小時 新手友好度 87/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 66/100
bitcoindevkit/bdk#2432 ·
維護者通常 3 天內回覆