Converting the International Date (AD) to Nepali Date (BS)
Posted on 2004-11-21
I'm currently developing a software in Nepali. The authorised date format for the office use in Nepal is Bikram Sambat. So, I need to have date facility in BS for the software. But it is quite tough as computer system do not accept BS dates. The main thing is that I need such a function in VB.Net that converts AD dates to BS dates and vice-versa. In a simple trend, while experimenting, I found that there is a approximate difference of 57 years, 8 months and 16 days between these dates. To obtain BS date, you need to add 57 years, 8 months and 16 days to AD date. But the main problem is that there may be a difference of +/- 3 days. I experimented with four dates and they are like below and they are in the format yyyy-mm-dd :
I tried a different approach, of storing english date and equivalent nepali date in a database and reading from it. But that made the application very bulky and it is really impossible to store all the BS dates in a database. What if someone wants to go back 120 years or forward 125 years.
Please help me to solve this problem, because I have seen such an application which actually does the same job accuractly.