On Fri, Jul 9, 2010 at 3:41 AM, Pratik Anand <pratik.preet(a)gmail.com> wrote:
unfortunately, the hindu calendar varies much from the our de-facto
in no. of days in months.
So, I am looking for an algorithm which does it effectively , otherwise, I
will have to write it from scratch which may have some bugs(in dates).
the app first calculates the time in seconds(unix epoch way) then converts
it to gregorian. This info be of help,if any.
Why writing from scratch should be difficult ?
From the wiki link provided by Sudheer:
Chaitra 1, 1879 Saka Era, == March 22, 1957
Consider this as your 'epoch'.
1. Calculate no of days from epoch (ndays)
e.g: 31 Aug, 2010 is '19521'
Add 'ndays' to Chaitra 1, 1879 using the Indian calendaring system.
the table gives number of days for each month and conditions for leap
years / leap months are also given.
Both subtraction of dates and adding a duration to date, are standard
exercise problems for first course in C programming.