Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

输出堆栈信息文件 日期有误 #44

Open
lbwstco opened this issue May 23, 2023 · 1 comment
Open

输出堆栈信息文件 日期有误 #44

lbwstco opened this issue May 23, 2023 · 1 comment

Comments

@lbwstco
Copy link

lbwstco commented May 23, 2023

导出的excel中调用月份提前了一个月

测试机器: Android 13(LineageOS 20) Pixel 2XL

@wintermoon99
Copy link

在script.js文件下,修改 get_format_time() 函数中myDate.getMonth()+1即可:

function get_format_time() {
    var myDate = new Date();
    return myDate.getFullYear() + '-' + (myDate.getMonth()+1) + '-' + myDate.getDate() + ' ' + myDate.getHours() + ':' + myDate.getMinutes() + ':' + myDate.getSeconds();
}

问题原因:JavaScript中的Date对象的getMonth()方法,返回的月份值是从0开始,范围从0到11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants