Hi,

On Fri, Jul 9, 2010 at 3:41 AM, Pratik Anand <[email protected]> wrote:
>
> unfortunately, the hindu calendar varies much from the  our de-facto
system
> 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:
http://en.wikipedia.org/wiki/Indian_national_calendar

 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'
http://www.timeanddate.com/date/durationresult.html?d1=31&m1=08&y1=2010&d2=22&m2=03&y2=1957

<http://www.timeanddate.com/date/durationresult.html?d1=31&m1=08&y1=2010&d2=22&m2=03&y2=1957>2.
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.

Regards,
Sourabh
-- 
http://mm.glug-bom.org/mailman/listinfo/linuxers

Reply via email to