LeviLamina icon indicating copy to clipboard operation
LeviLamina copied to clipboard

LLSE new Date() time bug

Open BuslnwTH opened this issue 1 year ago • 1 comments

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

image

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

BuslnwTH avatar Aug 11 '22 13:08 BuslnwTH

GMT+0000 as it should be GMT+0700 (System Timezone) image

BuslnwTH avatar Aug 11 '22 13:08 BuslnwTH

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

yqs112358 avatar Aug 12 '22 03:08 yqs112358

问题已定位,是quickjs源码未对win32平台制作相关实现 image 稍后尝试修复

yqs112358 avatar Aug 12 '22 03:08 yqs112358

已修复,等待2.5.1版本更新

yqs112358 avatar Aug 12 '22 11:08 yqs112358