Converting to and from Hindu calendar

www.data-blogger.com picture www.data-blogger.com · Dec 27, 2011 · Viewed 8.6k times · Source

How can I convert unix time to Hindu calendar­Wikipedia time and the other way round in php, Perl or Python or Java? I know I can convert to Hebrew and Jewish. But Hindu is not an option.

To be more specific, I'm talking about the Hindu lunar calendar. The following website is working and does exactly what I want: http://web.meson.org/calendars/. For example, it 'translates' 28-1-2012 (Gregorian) to 5-11-2068 (Hind. Lun.). How can I accomplish the same task? And if there are absolutely no scrips out there, how can I write it myself?

Answer

raina77ow picture raina77ow · Feb 25, 2012

Did you check DateTime-Indic-0.1 family of modules? At least DateTime::Indic::Chandramana seems to have a method to convert traditional date into UTC values (utc_rd_values).

UPDATE:

I suppose Calendar::Saka may be useful as well for many users (as I have known, it's the Indian national calendar), in particular, to_gregorian() and from_gregorian() methods.