public static long persianToJulian(long year,int month,int day){
  return 365L * ((ceil(year - 474L,2820D) + 474L) - 1L) + ((long)Math.floor((682L * (ceil(year - 474L,2820D) + 474L) - 110L) / 2816D)) + (PersianCalendarConstants.PERSIAN_EPOCH - 1L) + 1029983L * ((long)Math.floor((year - 474L) / 2820D)) + (month < 7 ? 31 * month : 30 * month + 6) + day;
}

public static long persianToJulian ( long year , int month , int day ) { return 365L * ( ( ceil ( year - 474L , 2820D ) + 474L ) - 1L ) + ( ( long ) Math . floor ( ( 682L * ( ceil ( year - 474L , 2820D ) + 474L ) - 110L ) / 2816D ) ) + ( PersianCalendarConstants . PERSIAN_EPOCH - 1L ) + 1029983L * ( ( long ) Math . floor ( ( year - 474L ) / 2820D ) ) + ( month < 7 ? 31 * month : 30 * month + 6 ) + day ; }
converts a provided persian ( shamsi ) date to the julian day number ( i . e . the number of days since january 1 in the year 4713 bc ) . since the persian calendar is a highly regular calendar , converting to and from a julian day number is not as difficult as it looks . basically it ' s a mather of dividing , rounding and multiplying . this routine uses julian day number 1948321 as focal point , since that julian day number corresponds with 1 farvardin ( 1 ) 1 .
