2023-09-16 05:24:05 +01:00
|
|
|
local DateTime = require("@lune/datetime")
|
2023-09-11 18:52:07 +01:00
|
|
|
|
|
|
|
assert(
|
|
|
|
DateTime.fromUniversalTime({
|
2023-09-16 05:24:05 +01:00
|
|
|
year = 2023,
|
|
|
|
month = 8,
|
|
|
|
day = 26,
|
|
|
|
hour = 16,
|
|
|
|
minute = 56,
|
|
|
|
second = 28,
|
|
|
|
millisecond = 0,
|
|
|
|
}).unixTimestamp == 1693068988,
|
2023-09-11 18:52:07 +01:00
|
|
|
"expected DateTime.fromUniversalTime() with DateTimeValues arg to return 1693068988s"
|
|
|
|
)
|
|
|
|
|
|
|
|
assert(
|
|
|
|
DateTime.fromUniversalTime({
|
2023-09-16 05:24:05 +01:00
|
|
|
year = 2023,
|
|
|
|
month = 8,
|
|
|
|
day = 26,
|
|
|
|
hour = 16,
|
|
|
|
minute = 56,
|
|
|
|
second = 28,
|
|
|
|
millisecond = 892,
|
|
|
|
}).unixTimestampMillis == 1693068988892,
|
2023-09-11 18:52:07 +01:00
|
|
|
"expected DateTime.fromUniversalTime() with DateTimeValues arg with millis to return 1693068988892ms"
|
|
|
|
)
|