Frequently Asked Questions

Everything you need to know about converting Bikram Sambat (BS) to Gregorian (AD) dates

Can't find what you're looking for? Check our Code Examples or API Documentation

Getting Started

What is Bikram Sambat (BS)?

Bikram Sambat (BS) is the official calendar system of Nepal, named after King Vikramaditya. It's a solar calendar that's approximately 56-57 years ahead of the Gregorian (AD) calendar. For example, January 2026 AD corresponds to around Poush-Magh 2082 BS.

Key characteristics of BS calendar:

  • New Year starts in mid-April (usually April 13-15)
  • 12 months with varying lengths (29-32 days)
  • Used for official government documents in Nepal
  • Based on astronomical calculations

What is the difference between BS and AD?

Bikram Sambat (BS) is Nepal's official calendar, approximately 56-57 years ahead of the Gregorian calendar. Anno Domini (AD) is the international Gregorian calendar used worldwide.

Feature Bikram Sambat (BS) Gregorian (AD)
Year Difference ~56-57 years ahead Current international standard
New Year Mid-April (Baisakh 1) January 1
Month Lengths Variable (29-32 days) Fixed (28-31 days)
Calendar Type Solar Solar
Official Use Nepal International

How do I convert BS to AD manually?

Manual conversion is complex because BS months have irregular lengths. We recommend using our free converter:

  1. Web Tool: Visit our converter and enter your BS date
  2. API: Use https://sudhanparajuli.com.np/api/bs-to-ad/{year}/{month}/{day}
  3. Iframe Widget: Embed our converter widget on your website

The conversion requires a lookup table of day counts for each BS year, which our algorithm handles automatically.

How do I convert AD to BS manually?

Converting Gregorian (AD) to Bikram Sambat (BS) is also complex due to the irregular month lengths in BS calendar. We provide multiple easy options:

  1. Web Tool: Visit our converter and enter your AD date
  2. API: Use https://sudhanparajuli.com.np/api/ad-to-bs/{year}/{month}/{day}
  3. Iframe Widget: Embed our converter widget on your website

The conversion algorithm automatically handles the variable month lengths and year differences between the two calendar systems.

Is this date converter free to use?

Yes, completely free! Our Nepali date converter is 100% free for:

  • Personal use
  • Commercial applications
  • Educational projects
  • Government systems
  • Research and development

No registration, no API keys, no hidden fees. We only ask that you use it reasonably and don't abuse the service with excessive requests.

Programming & API

How do I convert BS to AD in Python?

Here's a simple Python example:

import requests

def convert_bs_to_ad(year, month, day):
    url = f"https://sudhanparajuli.com.np/api/bs-to-ad/{year}/{month}/{day}"
    response = requests.get(url)
    data = response.json()
    
    if data.get('success'):
        return data['result']
    return None

# Example usage
result = convert_bs_to_ad(2081, 10, 15)
print(f"AD: {result['year']}-{result['month']}-{result['day']}")

See more examples on our Code Examples page.

How do I convert AD to BS in Python?

Converting Gregorian (AD) to Bikram Sambat (BS) in Python is just as easy:

import requests

def convert_ad_to_bs(year, month, day):
    url = f"https://sudhanparajuli.com.np/api/ad-to-bs/{year}/{month}/{day}"
    response = requests.get(url)
    data = response.json()
    
    if data.get('success'):
        return data['result']
    return None

# Example usage
result = convert_ad_to_bs(2025, 1, 29)
print(f"BS: {result['year']}/{result['month']}/{result['day']}")

Both conversions work the same way - just use the appropriate endpoint!

How do I convert Nepali date to English date in JavaScript?

Use the fetch API for modern JavaScript:

async function convertBSToAD(year, month, day) {
    const url = `https://sudhanparajuli.com.np/api/bs-to-ad/${year}/${month}/${day}`;
    const response = await fetch(url);
    const data = await response.json();
    
    if (data.success) {
        return data.result;
    }
    return null;
}

// Usage
convertBSToAD(2081, 10, 15).then(result => {
    console.log(`AD: ${result.year}-${result.month}-${result.day}`);
});

This works in Node.js, React, Vue, Angular, and all modern browsers!

How do I convert English date to Nepali date in JavaScript?

Converting AD to BS in JavaScript is just as simple:

async function convertADToBS(year, month, day) {
    const url = `https://sudhanparajuli.com.np/api/ad-to-bs/${year}/${month}/${day}`;
    const response = await fetch(url);
    const data = await response.json();
    
    if (data.success) {
        return data.result;
    }
    return null;
}

// Usage
convertADToBS(2025, 1, 29).then(result => {
    console.log(`BS: ${result.year}/${result.month}/${result.day}`);
});

Works seamlessly with all JavaScript frameworks and modern browsers!

Do I need an API key?

No API key required! Our API is completely open and free. Just make HTTP GET requests to:

  • https://sudhanparajuli.com.np/api/bs-to-ad/{year}/{month}/{day}
  • https://sudhanparajuli.com.np/api/ad-to-bs/{year}/{month}/{day}

No authentication, no registration, no hidden requirements. Start using it immediately!

What format does the API return?

The API returns JSON format. Example response:

{
  "success": true,
  "input": {
    "year": 2081,
    "month": 10,
    "day": 15,
    "type": "BS"
  },
  "result": {
    "year": 2025,
    "month": 1,
    "day": 29,
    "type": "AD"
  }
}

Error responses include an error field with a descriptive message.

What programming languages can I use?

Any language that can make HTTP requests! We provide examples for:

  • Python - requests library and urllib
  • JavaScript - fetch API, axios, jQuery
  • PHP - file_get_contents and cURL

But it also works with Ruby, Java, C#, Go, Rust, Swift, Kotlin, R, MATLAB, and any other language. Check our code examples for ready-to-use snippets.

Are there any rate limits?

We don't enforce strict rate limits for reasonable use. Guidelines:

  • ✅ Acceptable: Normal application usage, caching results, batch processing with delays
  • ⚠️ Please avoid: Thousands of requests per second, automated scraping without delays

For high-volume needs, consider caching converted dates to reduce API calls.

Integration & Embedding

Can I use this in my React/Vue/Angular app?

Absolutely! The API is CORS-enabled and works perfectly with all modern frameworks:

  • React: Use in useEffect hooks or async functions
  • Vue.js: Call in mounted() or methods
  • Angular: Use HttpClient service
  • Svelte: Works with onMount and reactive statements
  • Next.js: Both client and server-side

See JavaScript examples for implementation details.

How do I embed the converter on my WordPress site?

Embedding on WordPress is easy using our iframe widget:

  1. Edit your post or page in WordPress
  2. Switch to HTML/Code editor mode
  3. Paste this code:
<iframe 
    src="https://sudhanparajuli.com.np/iframe" 
    width="100%" 
    height="400"
    frameborder="0" 
    title="Nepali Date Converter"
    style="border: 1px solid #ddd; border-radius: 8px;">
</iframe>

The widget is fully responsive and works on all devices!

Can I embed this on Blogger, Medium, or other platforms?

Yes! Any platform that allows HTML embedding supports our iframe widget:

  • Blogger: Use HTML view to paste iframe code
  • Wix: Add HTML iframe element
  • Squarespace: Use Code block
  • Webflow: Add Embed component
  • Ghost: Use HTML card

For platforms that don't support iframes, link to our web converter instead.

Does the API work with mobile apps?

Yes! Our REST API works perfectly with:

  • iOS: Swift URLSession, Alamofire
  • Android: Kotlin/Java HttpURLConnection, Retrofit, OkHttp
  • React Native: fetch API
  • Flutter: http package or Dio
  • Xamarin: HttpClient

The API is accessible from any mobile platform that can make HTTP requests.

Calendar Systems

Why do BS months have different lengths?

Unlike the Gregorian calendar, Bikram Sambat is based on astronomical calculations of the Sun's position. Each month represents a zodiac sign period, resulting in variable lengths:

  • Baisakh, Jestha, Ashar: typically 30-32 days
  • Shrawan, Bhadra, Ashwin: typically 30-31 days
  • Kartik, Mangsir, Poush: typically 29-30 days
  • Magh, Falgun, Chaitra: typically 29-30 days

This variation makes algorithmic conversion complex, which is why lookup tables are necessary.

How accurate is the conversion?

100% accurate within the supported date range! Our conversion uses:

  • Official Bikram Sambat calendar data
  • Verified day counts for each BS year
  • Tested against government calendar publications
  • Handles all edge cases correctly

The algorithm has been validated with thousands of test cases to ensure accuracy.

What date range is supported?

Our converter supports a wide range of dates:

  • BS dates: Approximately 1970 BS to 2100 BS
  • AD dates: Approximately 1913 AD to 2043 AD

This covers historical dates as well as future dates for planning purposes. Dates outside this range will return an error.

How do I convert today's date to Nepali date?

To convert the current date to BS:

  1. Web Interface: Visit our converter - it shows today's date automatically
  2. Programmatically: Get today's date in your code, then call the API:
// JavaScript
const today = new Date();
const url = `https://sudhanparajuli.com.np/api/ad-to-bs/${today.getFullYear()}/${today.getMonth() + 1}/${today.getDate()}`;

# Python
from datetime import datetime
today = datetime.now()
url = f"https://sudhanparajuli.com.np/api/ad-to-bs/{today.year}/{today.month}/{today.day}"

Technical Details

How do I handle API errors?

Always check the success field in the API response:

const response = await fetch('https://sudhanparajuli.com.np/api/bs-to-ad/2081/10/15');
const data = await response.json();

if (data.success) {
    // Use data.result
    console.log(data.result);
} else {
    // Handle error
    console.error(data.error);
}

Common errors include invalid dates, out-of-range values, or malformed requests.

Does the API support HTTPS?

Yes! All API endpoints are served over HTTPS for security:

  • https://sudhanparajuli.com.np/api/...
  • http:// (redirects to HTTPS)

Always use HTTPS URLs to ensure encrypted communication.

Is CORS enabled for browser requests?

Yes! CORS (Cross-Origin Resource Sharing) is enabled for all origins. This means you can:

  • Call the API directly from browser JavaScript
  • Use it in single-page applications (React, Vue, Angular)
  • Make requests from any domain without proxy servers
  • Use it in CodePen, JSFiddle, and other online editors

Should I cache the conversion results?

Yes, caching is recommended for better performance:

  • Date conversions never change - 2081/10/15 BS is always 2025/1/29 AD
  • Cache results in localStorage, Redis, or your database
  • Reduces API calls and improves response time
  • Good for user experience and server load

Example: Store converted dates in localStorage with the BS date as the key.

What happens if I send an invalid date?

The API will return an error response with details:

{
  "error": "Invalid date: month must be between 1 and 12"
}

Common validation errors:

  • Month not between 1-12
  • Day exceeds month's maximum (e.g., day 33)
  • Date outside supported range
  • Invalid date format (non-numeric values)

Can I use this offline?

The API requires an internet connection. However, for offline use:

  • Cache results: Pre-convert and store dates you'll need
  • Use libraries: Consider Python's pyBSDate library for offline conversion
  • Download data: You could implement your own converter using BS calendar data tables

For most web applications, the API approach is simpler and always up-to-date.

Still Have Questions?

Can't find what you're looking for? We're here to help!