--
--
http://persian-computing.org/
http://groups.google.com/group/persian-computing/
---
You received this message because you are subscribed to the Google Groups "Persian Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to persian-computing+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
http://persian-computing.org/
http://groups.google.com/group/persian-computing/
---
You received this message because you are subscribed to the Google Groups "Persian Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to persian-computing+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If you check the FarsiWeb jalali.c, it's trivial to extract the part that converts Persian <=> Julian day number.
If you check the FarsiWeb jalali.c, it's trivial to extract the part that converts Persian <=> Julian day number.I have gone through that code many times... There is no explicit conversion between JDN and calendar date. There is a variable named `j_day_no' which I take it to be Jalali day number (number of days since Jalali epoch) just like `g_day_no'. Neither can lead us to a JDN<=>Jalali conversion. The `j_day_no' points to some time near 1593-03-21 B.C. (979/01-01 AP) which is 1139660 days after JDN = 0. (JDN epoch is -4713-01-01). Simply applying the offset, the algorithm fails to maintain sanity on day numbers (minus days). Also applying 3120 year offset to final calculations of year number didn't help.
function div(a,b) { return Math.floor(a/b); } function remainder(a,b) { return a - div(a,b)*b; }Hope that helps,
--
--
http://persian-computing.org/
http://groups.google.com/group/persian-computing/
---
You received this message because you are subscribed to the Google Groups "Persian Computing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to persian-computing+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reminds me that someone should put all the different jalali versions somewhere on github...
There are PersianCalendar.cs and JulianCalendar.cs in .NET ecosystem. They can be useful inspirations.
https://github.com/dotnet/coreclr/tree/master/src/mscorlib/shared/System/Globalization
--