Comments (17)
这个问题又出现了! @6tail
1946年9月30号 => 九月初五,实际上是九月初六才对。往前的日子都一样,按农历来算都是少一天!
版本:[v1.2.14]
然后老版本[v1.2.0]是没有这个问题的!
dart版本完全没问题,版本:1.2.12
from lunar-java.
from lunar-java.
from lunar-java.
from lunar-java.
from lunar-java.
我的提问里时间戳粘贴错了..稍等 我修改下
from lunar-java.
取了我现在的时间戳: 1639473146000 初始化后打印出农历: 二〇二一年冬月十一 ,这个是正确的
时间戳替换成: 681231600000 初始化后打印出农历: 一九九一年六月廿三, 这个是错误的,正确的应该一九九一年六月廿四
from lunar-java.
所以这个时间戳681231600000 应该是8月4号
from lunar-java.
应该是夏令时的问题?
from lunar-java.
from lunar-java.
应该是夏令时的问题,不过我感觉有点晕.在苹果上用苹果自带的库转过,是8.4号
from lunar-java.
你好,dart 我使用的是1.2.12版本,java是1.2.13的jar文件版本,我复制了你的dart test来执行,得到的结果跟你的不同.
很奇怪..
from lunar-java.
Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "macos_x64"
from lunar-java.
@6tail fromYmd确实没问题,但是fromCalendar和fromDate就有问题了
下面是单元测试
//1946年9月30号
@Test
fun test1() {
val calendar = Calendar.getInstance().apply {
this.set(Calendar.YEAR,1946)
this.set(Calendar.MONTH,8)//9月
this.set(Calendar.DAY_OF_MONTH,30)
this.set(Calendar.HOUR_OF_DAY, 0)
this.set(Calendar.MINUTE, 0)
this.set(Calendar.SECOND, 0)
this.set(Calendar.MILLISECOND, 0)
}
val solar = Solar.fromCalendar(calendar)
val lunar = solar.lunar
Assert.assertEquals("一九四六年九月初六", lunar.toString())
}
//1946年9月29号
@Test
fun test2() {
val calendar = Calendar.getInstance().apply {
this.set(Calendar.YEAR,1946)
this.set(Calendar.MONTH,8)//9月
this.set(Calendar.DAY_OF_MONTH,29)
this.set(Calendar.HOUR_OF_DAY, 0)
this.set(Calendar.MINUTE, 0)
this.set(Calendar.SECOND, 0)
this.set(Calendar.MILLISECOND, 0)
}
val solar = Solar.fromCalendar(calendar)
val lunar = solar.lunar
Assert.assertEquals("一九四六年九月初五", lunar.toString())
}
from lunar-java.
@6tail 你说的设置时区是App里还是手机里的,我刚试了一下你的单元测试,依然是有问题的
from lunar-java.
@6tail 我现在先把Calendar和Date转Solar然后在转Lunar就没问题了。但是这样子,Lunar.fromDate和Lunar.fromCalendar就不能用了~
from lunar-java.
from lunar-java.
Related Issues (20)
- 公历2022年12月7日(冬月十四)的每日宜忌和中华万年历等日历算出的结果不同 HOT 3
- 请问支持公元前吗 HOT 8
- 有没有对排盘进行解说的,请教 HOT 2
- 1.2.26jar包引入 无法使用 HOT 1
- 请问一下,代码中,国家规定节假日的更新,大概是什么时候呢?是不是我们自己本地下载维护好一点呢?期待解答,谢谢大佬 HOT 3
- 月日的干支都错了 HOT 5
- 如何获取佛历月历呢 HOT 1
- 1991-05-12 的日干支好像错了 HOT 3
- 有很多年份的1月1日无法初始化 HOT 2
- 关于是否能使用在kotlin上 HOT 3
- 请教如何判断当天是否是黄道吉日? HOT 1
- java.lang.NoClassDefFoundError: com.nlf.calendar.I18n HOT 10
- 星座返回的不是中文? HOT 1
- java公历转农历速度有点慢 HOT 1
- 法定节假日返回的不是中文 HOT 1
- 请问有流日和流时的算法么 HOT 1
- 博主2024年日历出来啦,该更新了 HOT 2
- 月柱是不是有问题? HOT 2
- 使用toFullString() API 报错 HOT 1
- 地支藏干表 中巳的余气和杂气反了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lunar-java.