lune/tests/datetime/toIsoDate.luau

10 lines
225 B
Lua
Raw Normal View History

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()"
)