space lua: os.date add support for %U, %V and %W (#1250)

This commit is contained in:
KitAmbraid
2025-02-22 12:00:54 +01:00
committed by GitHub
parent 2a3c926849
commit 31792a3a43
3 changed files with 39 additions and 3 deletions
+5 -1
View File
@@ -6,4 +6,8 @@ end
-- Basic OS functions
assert(os.time() > 0)
assert(os.date("%Y-%m-%d", os.time({ year = 2020, month = 1, day = 1 })) == "2020-01-01")
assert(os.date("%Y-%m-%d", os.time({ year = 2020, month = 1, day = 1 })) == "2020-01-01")
-- Week calculations
assert(os.date("%U %V %W", os.time({ year = 2051, month = 1, day = 1 })) == "01 52 00")
assert(os.date("%U %V %W", os.time({ year = 2025, month = 2, day = 18})) == "07 08 07")