Files
marqdo/lib/datetime.mq.md
T
cflmyandCursor bfb10d172b feat(markup): adopt v0.3 as sole mapping (** code, * return)
Make prose-unified Markup the only runtime: bold segments are executable,
italic is return, params can be inferred from body/prose, with no v0.2 dual
mode. Migrate lib and structure/keywords golds; gate on tests/markup-v03.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:38:53 +08:00

55 lines
1.0 KiB
Markdown

---
title: lib/datetime
description: Calendar moments as maps {unix, zone, iso} (Mid2 M7). Fixed offsets + a few IANA aliases.
---
## now
Current UTC moment map.
*> host_datetime_now*
## from_unix
+ `unix`
+ `zone`=None
*> host_datetime_from_unix unix=`unix` zone=`zone`*
## to_unix
+ `dt`
*> host_datetime_to_unix dt=`dt`*
## parse
+ `text`
+ `pattern`=None
RFC3339 / `YYYY-MM-DD[ HH:MM:SS]` by default; `pattern=` is strftime or `rfc3339`.
*> host_datetime_parse text=`text` pattern=`pattern`*
## format
+ `dt`
+ `style`=None
Styles: `rfc3339` (default), `date`, `time`, or a strftime pattern.
*> host_datetime_format dt=`dt` style=`style`*
## add
+ `dt`
+ `days`=None
+ `hours`=None
+ `minutes`=None
+ `seconds`=None
*> host_datetime_add dt=`dt` days=`days` hours=`hours` minutes=`minutes` seconds=`seconds`*
## in_zone
+ `dt`
+ `zone`
Re-express the same instant in `+08:00` / `UTC` / fixed aliases like `Asia/Shanghai`.
*> host_datetime_in_zone dt=`dt` zone=`zone`*