Wednesday, 14 December 2016

Julian Date function for Processing

... 
//find number of days until 24 june 2017
print (jDate(2017,06,24)-jDate(year(),month(),day()),"\n") ;
...
}


int jDate(int year,int month,int day){
 int JDN;
//based on the formula in Wiki

 JDN= day+floor((153*month+2)/5)+365*year+floor(year/4)-floor(year/100)+floor(year/400)-32045;
 

return JDN;
}

No comments: