如何在JAVA中将计算机日历转换为Hijri日历 [英] how to convert Computer Calender To Hijri Calender in JAVA
问题描述
实际上我正在搜索一个代码或算法,我可以将计算机日历转换为伊朗日历,但是有一些问题
闰年我怎么能按分区计算他们的年份数为4? 2-i可以计算一年中的日期,但是可以计算月份和日期。天我不能,实际上我遇到了一些算法但是当你试着测试它们时它们已经工作了好几天
这是我已经得到的公式算法,但它几天都不起作用。
(总天数)-226899 + 503/365 =答案-1 ==年份
(总天数)-226899 + 503%365 =回答 - (基督徒日历的月份)
直到答案将小于31
actually i was searching for a code or algorithm which i could convert the computer calender to Iranian calender but there are a few problems
for leap year how could I count them by division the number of right year to 4? 2-i can count the date the year but for month & days i can not ,actually I faced to some algorithm but when you try to test them they are not working for days
this is the formula which i already get for the algorithm but it doesn't work for days.
(total of days) -226899 +503/365=answer -1 ==year
(total of days) -226899 +503%365=answer-(the months of Christian calender)
till the answer will be less than 31
推荐答案
不要害怕使用Google: http ://junaedhalim.blogspot.com/2010/01/hijri-calendar-in-java-using-kuwaiti.html [ ^ ]
Don't be afraid to use Google: http://junaedhalim.blogspot.com/2010/01/hijri-calendar-in-java-using-kuwaiti.html[^]
这篇关于如何在JAVA中将计算机日历转换为Hijri日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!