Friday, April 22, 2011

Nepali Calendar in java

How to create, convert Nepali Date in java,asp,php, how to create, convert Nepali Calendar in java,asp,php, List of Nepal Year, months and days
Convert Nepal Date in Java, .Net , php...
Many people might want to convert Nepal Date from English Date or Nepal Calendar implementation in java. English Date implementation can be found everywhere but its a bit difficult to create nepali calendar in java.
English Date API is already available in J2EE, but Nepali date format is not included in any API. Here is few step to implements Nepali Calendar in java,asp,php,jsp etc. Best idea is just convert English date into Nepali Date and implement nepali calendar.
First of all we need to define list of year and days of 12 months that that year.
Once that is defined then we can derive day name for each date.
Here is the list of year and its days for each month.
{Year,Days in first month,Days in second month,Days in third month,.......}
{2030,31,32,31,32,31,30,30,30,29,29,30,31},
{2031,30,32,31,32,31,30,30,30,29,30,29,31},
{2032,31,31,32,31,31,31,30,29,30,29,30,30},
{2033,31,31,32,32,31,30,30,29,30,29,30,30},
{2034,31,32,31,32,31,30,30,30,29,29,30,31},
{2035,30,32,31,32,31,31,29,30,30,29,29,31},
{2036,31,31,32,31,31,31,30,29,30,29,30,30},
{2037,31,31,32,32,31,30,30,29,30,29,30,30},
{2038,31,32,31,32,31,30,30,30,29,29,30,31},
{2039,31,31,31,32,31,31,29,30,30,29,30,30},
{2040,31,31,32,31,31,31,30,29,30,29,30,30},
{2041,31,31,32,32,31,30,30,29,30,29,30,30},
{2042,31,32,31,32,31,30,30,30,29,29,30,31},
{2043,31,31,31,32,31,31,29,30,30,29,30,30},
{2044,31,31,32,31,31,31,30,29,30,29,30,30},
{2045,31,32,31,32,31,30,30,29,30,29,30,30},
{2046,31,32,31,32,31,30,30,30,29,29,30,31},
{2047,31,31,31,32,31,31,30,29,30,29,30,30},
{2048,31,31,32,31,31,31,30,29,30,29,30,30},
{2049,31,32,31,32,31,30,30,30,29,29,30,30},
{2050,31,32,31,32,31,30,30,30,29,30,29,31},
{2051,31,31,31,32,31,31,30,29,30,29,30,30},
{2052,31,31,32,31,31,31,30,29,30,29,30,30},
{2053,31,32,31,32,31,30,30,30,29,29,30,30},
{2054,31,32,31,32,31,30,30,30,29,30,29,31},
{2055,31,31,32,31,31,31,30,29,30,29,30,30},
{2056,31,31,32,31,32,30,30,29,30,29,30,30},
{2057,31,32,31,32,31,30,30,30,29,29,30,31},
{2058,30,32,31,32,31,30,30,30,29,30,29,31},
{2059,31,31,32,31,31,31,30,29,30,29,30,30},
{2060,31,31,32,32,31,30,30,29,30,29,30,30},
{2061,31,32,31,32,31,30,30,30,29,29,30,31},
{2062,30,32,31,32,31,31,29,30,29,30,29,31},
{2063,31,31,32,31,31,31,30,29,30,29,30,30},
{2064,31,31,32,32,31,30,30,29,30,29,30,30},
{2065,31,32,31,32,31,30,30,30,29,29,30,31},
{2066,31,31,31,32,31,31,29,30,30,29,29,31},
{2067,31,31,32,31,31,31,30,29,30,29,30,30},
{2068,31,31,32,32,31,30,30,29,30,29,30,30},
{2069,31,32,31,32,31,30,30,30,29,29,30,31},
{2070,31,31,31,32,31,31,29,30,30,29,30,30},
{2071,31,31,32,31,31,31,30,29,30,29,30,30},
{2072,31,32,31,32,31,30,30,29,30,29,30,30},
{2073,31,32,31,32,31,30,30,30,29,29,30,31},
{2074,31,31,31,32,31,31,30,29,30,29,30,30},
{2075,31,31,32,31,31,31,30,29,30,29,30,30},
{2076,31,32,31,32,31,30,30,30,29,29,30,30},
{2077,31,32,31,32,31,30,30,30,29,30,29,31},
{2078,31,31,31,32,31,31,30,29,30,29,30,30},
{2079,31,31,32,31,31,31,30,29,30,29,30,30},
{2080,31,32,31,32,31,30,30,30,29,29,30,30}
etc..

With the help of above data you can start implementation of Nepali Calendar in Java, Nepali Calendar in .Net, Nepali Calendar in ASP, Nepali Calendar in Php etc.

2 comments:

  1. Gr8, I was looking this logic, I tried to find out Nepali calendar in php,Nepali calendar in .net but no luck, finally I made it. thanks buddy.

    ReplyDelete
  2. nice. I was also looking for this info. Thanks for the post.

    ReplyDelete