-
Notifications
You must be signed in to change notification settings - Fork 153
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
Lunar阳历日期转换出错,算法不对 #21
Comments
Calendar要设置时区。 |
用这个方法不就不用转换了 |
Calendar和Date都需要注意时区。 |
刚开始我也以为不对, 翻看了文档才发现是自己使用方法有问题, 目前验证出来的都没有问题, 我只能说大佬太牛皮了, 请收下我的膝盖, 这些质疑有错误的issues我觉得可以关了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我明明设置一个【1986-9-1 00:02:02 】的数据,并且转换成为一个13位的时间戳, 根据时间戳导入后-转换后竟然变成【1986-08-31 23:02:02 】
这个时间戳计算差了1天,连日期都改变了 //实测 Andriod Java 运行日期计算错误,时间戳转换日期出错
//设置一个1986-9-1 的数据
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,1986);
calendar.set(Calendar.MONTH,8);
calendar.set(Calendar.DAY_OF_MONTH,1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 2);
calendar.set(Calendar.SECOND, 2);
打印结果
Lunar阳历日期:1986-08-31 23:02:02 星期日 处女座
我明明设置一个【1986-9-1 00:02:02 】的数据,并且转换成为一个时间戳, 导入后-转换后竟然变成【1986-08-31 23:02:02 】
The text was updated successfully, but these errors were encountered: