title: how to calculate lunation number moon phases
body: <p>how to calculate lunation number from given date </p>
  
  <p>I have tried many methods but still wrong output </p>
  
  <p>Method 1</p>
  
  <pre><code>$SYNODIC_MONTH = 29.530588861;
       $LUNATION_BASE = 2423436.40347; 
       echo   round(( (gregoriantojd (10,25,2003) - $LUNATION_BASE ) / $SYNODIC_MONTH ));
  </code></pre>
  
  <p>an output is 999 but on 25 October 2003 lunation number is 1000</p>
  
  <p>method 2 produce the same result </p>
  
  <pre><code>$now =strtotime('2003-10-25');
             $diff =$now-strtotime('1923-1-17'); 
              $days= round($diff/86400);
         echo '&lt;br&gt;'. round($lunations = 0.20439731 + $days * 0.03386319269);
  </code></pre>
  
  <p><a href="https://en.wikipedia.org/wiki/New_moon" rel="nofollow noreferrer">help from wikipedia</a></p>
  
  <p><a href="http://scienceworld.wolfram.com/astronomy/Lunation.html" rel="nofollow noreferrer">lunations numbers table</a></p>