Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>if we get a double julian date such as chordiant decision manager</p> <p><a href="http://java.ittoolbox.com/groups/technical-functional/java-l/java-function-to-convert-julian-date-to-calendar-date-1947446" rel="nofollow noreferrer">http://java.ittoolbox.com/groups/technical-functional/java-l/java-function-to-convert-julian-date-to-calendar-date-1947446</a></p> <p>The following is working but second is not taken care of <a href="https://stackoverflow.com/questions/5655034/how-can-i-convert-between-a-java-date-and-julianday-number">How can I convert between a Java Date and Julian day number?</a></p> <p>public static String julianDate(String julianDateStr) {</p> <pre><code> try{ // Calcul date calendrier Gr?gorien ? partir du jour Julien ?ph?m?ride // Tous les calculs sont issus du livre de Jean MEEUS "Calcul astronomique" // Chapitre 3 de la soci?t? astronomique de France 3 rue Beethoven 75016 Paris // Tel 01 42 24 13 74 // Valable pour les ann?es n?gatives et positives mais pas pour les jours Juliens n?gatifs double jd=Double.parseDouble(julianDateStr); double z, f, a, b, c, d, e, m, aux; Date date = new Date(); jd += 0.5; z = Math.floor(jd); f = jd - z; if (z &gt;= 2299161.0) { a = Math.floor((z - 1867216.25) / 36524.25); a = z + 1 + a - Math.floor(a / 4); } else { a = z; } b = a + 1524; c = Math.floor((b - 122.1) / 365.25); d = Math.floor(365.25 * c); e = Math.floor((b - d) / 30.6001); aux = b - d - Math.floor(30.6001 * e) + f; Calendar calendar = new GregorianCalendar(); calendar.setTime(date); calendar.set(Calendar.DAY_OF_MONTH, (int) aux); double hhd= aux-calendar.get(Calendar.DAY_OF_MONTH); aux = ((aux - calendar.get(Calendar.DAY_OF_MONTH)) * 24); calendar.set(Calendar.HOUR_OF_DAY, (int) aux); calendar.set(Calendar.MINUTE, (int) ((aux - calendar.get(Calendar.HOUR_OF_DAY)) * 60)); // Calcul secondes double mnd = (24 * hhd) - calendar.get(Calendar.HOUR_OF_DAY); double ssd = (60 * mnd) - calendar.get(Calendar.MINUTE); int ss = (int)(60 * ssd); calendar.set(Calendar.SECOND,ss); if (e &lt; 13.5) { m = e - 1; } else { m = e - 13; } // Se le resta uno al mes por el manejo de JAVA, donde los meses empiezan en 0. calendar.set(Calendar.MONTH, (int) m - 1); if (m &gt; 2.5) { calendar.set(Calendar.YEAR, (int) (c - 4716)); } else { calendar.set(Calendar.YEAR, (int) (c - 4715)); } SimpleDateFormat sdf=new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); //System.out.println("Appnumber= "+appNumber+" TimeStamp="+timeStamp+" Julian Date="+julianDateStr+" Converted Date="+sdf.format(calendar.getTime())); return sdf.format(calendar.getTime()); }catch(Exception e){ e.printStackTrace(); } return null; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload