Class GpsTimeConverter
- java.lang.Object
-
- org.hortonmachine.gears.io.las.utils.GpsTimeConverter
-
public class GpsTimeConverter extends Object
Gps Time converterAdapted from the javascript version of: https://losc.ligo.org/gps/
Following may be helpful for conversion when new leap seconds are announced.
gnu 'date': date --date='2012-06-30 23:59:59' +%s
source: https://losc.ligo.org/s/js/gpstimeutil.js
GPS time was born at the 1/5/1980 to 1/6/1980 midnight. January 6, 1980 is a Sunday. GPS Time counts in weeks and seconds of a week from this instant. The weeks begin at the Saturday/Sunday transition. The days of the week are numbered, with Sunday being 0, Saturday is day 6
- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringISO8601_patternstatic org.joda.time.format.DateTimeFormatterISO8601Formatter
-
Constructor Summary
Constructors Constructor Description GpsTimeConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubledateTime2gps(double dateTimeMillis)ConvertDateTimeto GPS Time.static org.joda.time.DateTimegpsWeekTime2DateTime(double gpsWeekTime)Convert GPS Week Time toDateTime.static StringgpsWeekTime2ISO8601(double gpsWeekTime)Convert GPS Time to ISO8601 time string.static EGpsWeekDaysgpsWeekTime2WeekDay(double gpsWeekTime)Convert GPS Week Time to the day of the week.
-
-
-
Field Detail
-
ISO8601_pattern
public static String ISO8601_pattern
-
ISO8601Formatter
public static org.joda.time.format.DateTimeFormatter ISO8601Formatter
-
-
Method Detail
-
dateTime2gps
public static double dateTime2gps(double dateTimeMillis)
ConvertDateTimeto GPS Time.- Parameters:
dateTimeMillis- the datetime to convert (millis).- Returns:
- the gps time.
-
gpsWeekTime2DateTime
public static org.joda.time.DateTime gpsWeekTime2DateTime(double gpsWeekTime)
Convert GPS Week Time toDateTime.- Parameters:
gpsWeekTime- the gps time.- Returns:
- the
DateTimeof the gps time.
-
gpsWeekTime2WeekDay
public static EGpsWeekDays gpsWeekTime2WeekDay(double gpsWeekTime)
Convert GPS Week Time to the day of the week.- Parameters:
gpsWeekTime- the gps time.- Returns:
- the day of the week.
-
gpsWeekTime2ISO8601
public static String gpsWeekTime2ISO8601(double gpsWeekTime)
Convert GPS Time to ISO8601 time string.- Parameters:
gpsWeekTime- the gps time.- Returns:
- the ISO8601 string of the gps time.
-
-