0

I want to convert the given julian date into normal date . how to do that in php ?

here is the one i have tried

$juliantime = 735315
$unixTime = jdtounix($juliantime );

but it returns false

Is there any way to convert this julian to normal date ?

  • 3
    `Parameters: jday A julian day number between 2440588 and 2465342.` http://www.php.net/manual/en/function.jdtounix.php – Realitätsverlust Apr 02 '14 at 08:58
  • What date is "735315" supposed to represent? – deceze Apr 02 '14 at 08:59
  • PHP's date/time facilities will probably let you down with dates so far back in the past even if you manually figure out the conversion. What exactly do you want to do with the result assuming you have it? – Jon Apr 02 '14 at 09:00
  • @deceze it is julian date ! –  Apr 02 '14 at 09:01
  • @Jon I want to get the normal date for a julian date ! –  Apr 02 '14 at 09:02
  • @deceze - 2700-Mar-08? – missing_one Apr 02 '14 at 09:02
  • Yes, but since it's way out of range, I'm asking you what the result should be. – deceze Apr 02 '14 at 09:02
  • @StackExchange: I didn't ask what you want to get. I asked what you are going to do with it. – Jon Apr 02 '14 at 09:04
  • @YUNOWORK http://www.longpelaexpertise.com.au/toolsJulian.php here i can able to convert into normal date and i just want a way to convert not only using jdtounix –  Apr 02 '14 at 09:05
  • @Jon I have complete list of julian date s . I want to show my user these in normal days –  Apr 02 '14 at 09:07
  • @StackExchange: That date is around 2700 BC. You cannot accurately display a date in 2700 BC and expect any modern person to make something useful out of it because the calendar rules have changed between then and now several times and in obscure ways. In addition, where do these dates come from? It's highly unlikely that you have a date-accurate historic account of something that happened in 2700 BC. – Jon Apr 02 '14 at 09:12
  • @Jon So the conversion is correct ? only the date is wrong right ? –  Apr 02 '14 at 09:16
  • @StackExchange: Sorry, but I have no idea what you are trying to ask. – Jon Apr 02 '14 at 09:18
  • @Jon you said the date is wrong . So the code above is correct to convert julian to normal right? any way NP.! thanks for your comments –  Apr 02 '14 at 09:21

1 Answers1

0

The OP's example attempts to find the "normal" date corresponding to JD 735315. According to this website which has always given me good results, the correct answer is February 14, 2700 BC. This page of the PHP manual says the jdtounix command will return FALSE if the year is outside the range 1970 to 2037, which explains the OP's result.

The PHP gregoriantojd function claims the "Valid Range for Gregorian Calendar 4714 B.C. to 9999 A.D." I suggest the converse function jdtogregorian might do the job.

Gerard Ashton
  • 560
  • 4
  • 16