文档中的步骤
结构步骤(非实际执行时序)
marqdo
Moments are maps {unix, zone, iso}. Parse HTTPS URLs and round-trip query strings in lib/url (segment encoding stays in net.url_encode).
access(`epoch`, "iso")access(`u`, "host")access(`u`, "query")| unix | 0 |
| zone | +08:00 |
| iso | 1970-01-01T08:00:00+08:00 |
| key | value |
|---|---|
| unix | 0 |
| zone | +08:00 |
| iso | 1970-01-01T08:00:00+08:00 |
| scheme | https |
| userinfo | |
| host | example.com |
| port | None |
| path | /path |
| query | q=1 |
| … | |
| key | value |
|---|---|
| scheme | https |
| userinfo | |
| host | example.com |
| port | None |
| path | /path |
| query | q=1 |
| fragment | top |
结构步骤(非实际执行时序)
---
markup: occlusion
title: Mid stdlib — datetime and url
description: Calendar moments + URL/query parse (Mid2 M7)
import:
dt: lib/datetime.mq.md
url: lib/url.mq.md
---
# Time and addresses without plugins
Moments are maps `{unix, zone, iso}`. Parse HTTPS URLs and round-trip query strings in `lib/url` (segment encoding stays in `net.url_encode`).
# main
**epoch = > dt.from_unix unix=0 zone="Asia/Shanghai"**
> print text=[iso](access(`epoch`, "iso"))
**u = > url.parse text="https://example.com/path?q=1#top"**
> print text=[host](access(`u`, "host"))
> print text=[query](access(`u`, "query"))