lune/tests/datetime/toIsoDate.luau

9 lines
225 B
Lua

local DateTime = require("@lune/DateTime")
assert(
string.match(
DateTime.now():toIsoDate(),
"(%d%d%d%d)-?(%d?%d?)-?(%d?%d?)T(%d?%d?):(%d?%d?):(%d?%d?)Z$"
),
"invalid ISO 8601 date returned by dateTime.toIsoDate()"
)