title: DaysBetween in Pig Giving Wrong Result For Month Of March
body: <p>I am trying to convert a vertica query into Pig which basically find out the number of days between two dates.When i converted the code and tried using the DaysBetween function in PIG it is giving different output for month of March only.</p>
  
  <p><strong>PIG Result:</strong></p>
  
  <pre><code>Y = FOREACH X GENERATE
  (DaysBetween((datetime)ToDate('2015-04-01'),ToDate('2015-03-01')));
  Output:- (30)
  </code></pre>
  
  <p><strong>Vertica Result:</strong></p>
  
  <pre><code>SELECT JULIAN_DAY('2015-04-01')-JULIAN_DAY('2015-03-01');
  Output:- (31)
  </code></pre>
  
  <p>When i checked the same for other months of the year,I am not getting any errors. </p>
  
  <p><strong>PIG Result:</strong></p>
  
  <pre><code>Y = FOREACH X GENERATE
  (DaysBetween((datetime)ToDate('2015-03-04'),ToDate('2015-02-04')));
  Output:- (28)
  </code></pre>
  
  <p><strong>Vertica Result:</strong></p>
  
  <pre><code>SELECT JULIAN_DAY('2015-03-04')-JULIAN_DAY('2015-02-04');
   Output :- 28
  </code></pre>
  
  <p>I am unable to find the reason for the difference.Need some advice  on how to solve the issue.</p>