How can I convert unix
time to Hindu calendarWikipedia 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?
Unlike the Gregorian calendar which adds additional days to the month to adjust for the mismatch between twelve lunar cycles (354 lunar days) and nearly 365 solar days, the Hindu calendar maintains the integrity of the lunar month, but inserts an extra full month by complex rules, once every 32–33 months, to ensure ...
It is based on a year of 12 lunar months; i.e., 12 full cycles of phases of the Moon. The discrepancy between the lunar year of about 354 days and the solar year of about 365 days is partially resolved by intercalation of an extra month every 30 months.
Since year 1 of the Indian calendar differs from year 1 of the Gregorian, to determine whether a year in the Indian calendar is a leap year, add 78 to the year of the Saka era then apply the Gregorian calendar rule to the sum.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With