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 6983549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:26:03+00:00 2026-05-27T18:26:03+00:00

I’m currently writing some php code to convert dates from the Gregorian Calendar to

  • 0

I’m currently writing some php code to convert dates from the Gregorian Calendar to the Hebrew Calendar. Looking at the php calendar functions, I found that it has functions to convert from Gregorian to Julian days and Julian days to Hebrew. However, there is no function I could find to directly convert from Gregorian to Hebrew.

Out of curiousity, I wanted to see if a direct conversion was possible. While researching this though, I found that it seems to be standard to convert dates to Julian days, and then to the desired calendar system.

I found this in a few libraries like:
http://www.php.net/manual/en/ref.calendar.php
http://www.fourmilab.ch/documents/calendar/calendar.js

and mentioned on a forum post here:
http://www.physicsforums.com/showthread.php?t=173119

Whats bugging me is why! Is it a standard decided on by some group? Is it just done this way historically?

Wouldn’t it be more efficient to come up with algorithms to directly convert dates? or conversely, what makes Julian days so efficient?

  • 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-05-27T18:26:04+00:00Added an answer on May 27, 2026 at 6:26 pm

    If you want to convert between n different calendars and you implemented algorithms to go from any one format to any other format, you would need n^2 - n conversion algorithms. However if instead wrote algorithms to convert any calendar format to one baseline calendar format and then wrote algorithms to convert from the baseline format to any other format you only need to write 2(n-1) algorithms.

    These calendar formats are all representing the same thing, time. The most basic way to represent a time is as the amount of time elapsed since some reference point, so that makes the most sense as a baseline format. This is exactly what Julian Date is, the number of days since January 1, 4713 BC Greenwich noon.

    You might think that it would be slower converting from one format to Julian Date then to another format, however any specialized conversion algorithm is essentially going to take the input date, convert it to some neutral go between date representation and then convert that to the desired calendar format. However since Julian Date is a simple single number format this is effectively the same as converting to Julian Date and then converting to some other format so the performance gain would be negligible. Also calendar conversions are probably not the bottleneck of any application’s performance so squeezing the most possible performance out of them is probably not a good use of anyone’s time.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported

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.