我犯了一个错误,或者是HijrahDate库的错误?

问题描述 投票:1回答:1

我有这样的代码,我的应用程序,我想一个日期,如 "06斋月1441 "显示29.04.2020,但当我改变了日期3.4.2021,并检查它与" "。https:/www.islamicity.orghijri-gregorian-converterindex.php?address=undefined#"它说20. Shaban. 1442 但我的应用程序说21. Shaban. 1442

String hij_date = HijrahDate.now().toString();
int date_len = hij_date.length();
String d = hij_date.substring(date_len - 2, date_len);
String m = hij_date.substring(date_len - 5, date_len - 3);
String y = hij_date.substring(date_len - 10, date_len - 6);
textView.setText(d + " " + monthname(m) + " " + y);
textView.setTypeface(null, Typeface.BOLD);

谢谢你的帮助。

java android android-studio arabic hijri
1个回答
2
投票

我认为问题不在库中。Hijra日期和普通日期不同,他们是由月亮而不是太阳决定的。而且在如何确定日期上也有争论。有些人在4月24日开始过斋月,而其他人则在4月25日开始。

© www.soinside.com 2019 - 2024. All rights reserved.