Java Unix time unixToGST(double unix)

Here you can find the source of unixToGST(double unix)

Description

unix To GST

License

Apache License

Declaration

public static double unixToGST(double unix) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double unixToGST(double unix) {
        double jd = UnixToJulianDays(unix);
        double t = (jd - 2451545.0) / 36525.0 + 0.0005;
        double gst = 280.46061837 + 360.98564736629 * (jd - 2451545.0) + t * t * (0.000387933 - t / 38710000.0);

        while (gst >= 360) {
            gst -= 360;/*w  w w  .j a v  a 2 s .  co  m*/
        }

        while (gst <= 0) {
            gst += 360;
        }
        return gst;
    }

    public static double UnixToJulianDays(double unix) {
        return unix / 86400.0 + 2440587.5;
    }
}

Related

  1. unixTimestamp(int year, int month, int day, int hour, int minute, int second)
  2. unixTimestampToString(long timestamp)
  3. unixtimeToDate(long time)
  4. unixTimeToString(int time)
  5. unixTimeToString(int time, int precision)
  6. UnixToJulianDays(double unix)