Here you can find the source of dateToJulian(Date date)
public static double dateToJulian(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static double dateToJulian(Date date) { Calendar cal = Calendar.getInstance(); cal.set(1858, 10, 17, 0, 0, 0);/* ww w . ja v a 2 s .com*/ double day1 = cal.getTimeInMillis() / 86400000.0; cal.setTime(date); double day2 = cal.getTimeInMillis() / 86400000.0; return (day2 - day1); } }