Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:30:18+00:00 2026-06-09T00:30:18+00:00

I need to compare Bikram Sambat dates in PHP. Lets say today in AD

  • 0

I need to compare Bikram Sambat dates in PHP. Lets say today in AD is 2012-08-03, the BS date today is 2069-04-19. In BS, we have total number of days in a month ranging from 29 to 32. Again, the days are not consistent in every year. Example if this year current month have 31 days, next year same month might have 30 or even 32 days.

The way i could think is, using a php date converter class (which I already have), convert given BS Dates to equivalent AD Dates and compare them. Just i want to know is there any other better way to do this without using the class i have??

By saying comparing here I mean
a) Finding days between the given date ranges.
b) Checking whether a date lies on a given two date ranges
c) And other comparisons we could do with AD dates using php Date Function

thanks any help is highly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:30:20+00:00Added an answer on June 9, 2026 at 12:30 am

    Generally, I would suggest converting both dates to unix timestamps (seconds since 1970-1-1 AD) which is a simple integer value for comparison.

    Apparently, there is no simple logic behind BS so you will not be able to find an analytic expression that directly gets you from here to there. If you do not wish to use an external class you could write some sort of (recursive) function that starts from 1970-1-1 AD which you manually convert to BS and counts up the timestamp from there following the rules for BS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to compare two Date s (e.g. date1 and date2 ) and come
I need to compare two calendar dates. I wrote the javascript function too. But
I need to compare two dates with time (am/pm). I used the following code.
I need to compare whether date is less than 3 months old. I will
I need to compare a var foo = 'whatever' with THIS: <ul id=nav_main><li><a href=index.php?pag=THIS>link</a></li></ul>
I need to compare two value (date) from query . String myFormatString = yyyyMMdd;
i need to compare two objects but compare a number of their properties in
I need to compare two date in javascript. In my code I am calling
I need to compare a timestamp to a date. I would just like to
I need to compare two fix messages (say two ExecutionReports) in QuickFIXJ. Let's call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.