Skip to content

Commit 4979ac1

Browse files
authored
[Space Lua] Rewrite os.date to support UTC mode and strftime specifiers (#1835)
* Aligned with Lua 5.4 `os.date` semantics: `!` prefix selects UTC, absent format defaults to `%c`, `*t` returns a table with `isdst` only for local time, invalid specifiers raise an error. * All `strftime` specifiers documented in the Lua 5.4 reference manual are supported, including ISO week-based year (`%G`/`%g`/`%V`) and composite formats. * Extensive test suite uses the Go reference timestamp `2006-01-02 15:04:05 UTC` (epoch `1136214245`) where every field - year, month, day, hour, minute, second — has a distinct value. Tests cover UTC and local modes, AM/PM, Sunday edge cases for `%u`/`%w`, ISO week-year boundaries, `%%` escaping, `*t` table fields, and invalid specifier rejection. Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
1 parent 568a3b6 commit 4979ac1

File tree

2 files changed

+482
-156
lines changed

2 files changed

+482
-156
lines changed

0 commit comments

Comments
 (0)