mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
27 lines
596 B
Lua
27 lines
596 B
Lua
local DateTime = require("@lune/datetime")
|
|
|
|
assert(
|
|
DateTime.fromUniversalTime({
|
|
year = 2023,
|
|
month = 8,
|
|
day = 26,
|
|
hour = 16,
|
|
minute = 56,
|
|
second = 28,
|
|
millisecond = 0,
|
|
}).unixTimestamp == 1693068988,
|
|
"expected DateTime.fromUniversalTime() with DateTimeValues arg to return 1693068988s"
|
|
)
|
|
|
|
assert(
|
|
DateTime.fromUniversalTime({
|
|
year = 2023,
|
|
month = 8,
|
|
day = 26,
|
|
hour = 16,
|
|
minute = 56,
|
|
second = 28,
|
|
millisecond = 892,
|
|
}).unixTimestampMillis == 1693068988892,
|
|
"expected DateTime.fromUniversalTime() with DateTimeValues arg with millis to return 1693068988892ms"
|
|
)
|