Java Date Convert dateToJulian(Date date)

Here you can find the source of dateToJulian(Date date)

Description

date To Julian

License

Apache License

Declaration

public static double dateToJulian(Date date) 

Method Source Code

//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);
    }
}

Related

  1. dateToCal(Date date)
  2. dateToEnglishString(java.util.Date date)
  3. dateToFMDate(Date date)
  4. dateToInt(Date date)
  5. dateToISOXDSb(Date date)
  6. dateToLong(final Date date)
  7. DateToMask(Date javaDateType)
  8. dateToMorining(Date date)
  9. dateToNumber(Date date)