MCPcopy Create free account
hub / github.com/MenoData/Time4J / getModernUT

Method getModernUT

base/src/main/java/net/time4j/Moment.java:1982–1997  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1980 }
1981
1982 private double getModernUT() {
1983
1984 PlainDate date = this.getDateUTC();
1985 double utValue = this.getElapsedTimeUTC();
1986 utValue += 42.184;
1987 utValue += (this.getNanosecond() / (MRD * 1.0));
1988 utValue -= TimeScale.deltaT(date);
1989 long ut = (long) Math.floor(utValue);
1990
1991 if (Double.compare(MRD - (utValue - ut) * MRD, 1.0) < 0) {
1992 return ut + 1; // prevents rounding errors
1993 }
1994
1995 return utValue;
1996
1997 }
1998
1999 private static int toNanos(
2000 double value,

Callers 2

getElapsedTimeMethod · 0.95
getNanosecondMethod · 0.95

Calls 6

getDateUTCMethod · 0.95
getElapsedTimeUTCMethod · 0.95
getNanosecondMethod · 0.95
deltaTMethod · 0.95
floorMethod · 0.80
compareMethod · 0.65

Tested by

no test coverage detected