LeviLamina
LeviLamina copied to clipboard
LLSE new Date() time bug
Exceptions module
ScriptEngine
Operating System
Windows Server 2022
LiteLoader version
2.5.0
BDS version
1.19.20.02
What happened?
Left time wrong
Left (Yellow) use new Date(); Right (Green) use system.getTimeStr();
mc.listen("onJoin", function (player) {
setInterval(()=> {
let time = new Date();
let dateNew = "§e" + time.getFullYear() + "-" + time.getMonth() + "-" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + "§c || §a"
let timeStr = system.getTimeStr();
player.setBossBar(dateNew + timeStr, time.getSeconds(), 6);
},1000)
})
Steps to reproduce?
No response
Relevant log output
No response
Plugin list
No response
GMT+0000 as it should be GMT+0700 (System Timezone)
QuickJs engine's bug about time, trying to fix...
Addition: Your call to time.getMonth()
is wrong. Its range is [0,11] because of historical reasons. You need to +1
问题已定位,是quickjs源码未对win32平台制作相关实现
稍后尝试修复
已修复,等待2.5.1版本更新