function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Is there a julian date function in APEX,
For example today [May 28 2013] has the julian date 2456441
Thanks
Does this work for you?
public static Integer getJulianDate(Date theDate){ Integer y = theDate.year(); Integer j = theDate.month(); Integer k = theDate.day(); return ( K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12) /12-3*((I+4900+(J-14)/12)/100)/4 );}
Formula taken from here:
http://aa.usno.navy.mil/faq/docs/JD_Formula.php
Comparing it against a online converter it's pretty accurate (though the converter has decimal points in it).
Perfect,
Just an adjustment
public static Integer getJulianDate(integer I,integer J,integer K){
// I= YEAR // J= MONTH // K= DAY return ( K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12) /12-3*((I+4900+(J-14)/12)/100)/4 ); }
I is not defined.
Does this work for you?
Formula taken from here:
http://aa.usno.navy.mil/faq/docs/JD_Formula.php
Comparing it against a online converter it's pretty accurate (though the converter has decimal points in it).
All Answers
http://stackoverflow.com/questions/3036761/julian-date-conversion
Does this work for you?
Formula taken from here:
http://aa.usno.navy.mil/faq/docs/JD_Formula.php
Comparing it against a online converter it's pretty accurate (though the converter has decimal points in it).
Perfect,
Just an adjustment
public static Integer getJulianDate(integer I,integer J,integer K){
// I= YEAR
// J= MONTH
// K= DAY
return ( K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12) /12-3*((I+4900+(J-14)/12)/100)/4 );
}
I is not defined.