# Maritime

Industry: Maritime

Maritime is time at sea and in a ship's records. Ships and their shore systems take time from satellite receivers, carry it between instruments in standard sentences, and keep logs that outlive a receiver's week counter. This layer draws on the satellite clocks and the leap-second table, and adds no functions of its own.

## What these functions solve

- **A receiver starts reporting dates a whole counter period early.** [`gnssWeekToUtc`](/gmt/reference/gnss/convert/gnssWeekToUtc/) names the pass of the counter, so a week resolved against a build date can be checked against the pass it should be in. See [guide](/gmt/guides/industries/maritime-gnss-time-and-week-rollover/), [GNSS Rollover Checker](/gmt/tools/gnss-rollover-checker/).
- **A log mixes satellite time and UTC.** [`gnssToUtc`](/gmt/reference/gnss/convert/gnssToUtc/) turns a labelled satellite reading into UTC, for the system and the date it names. See [guide](/gmt/guides/industries/gnss-system-time-and-week-rollover/), [Satellite Clock Converter](/gmt/tools/satellite-clock-converter/).
- **A leap second turns up in a ship's record.** [`isLeapSecond`](/gmt/reference/timescale/validate/isLeapSecond/) tells whether a second sixty is a real one, whatever offset the record carries. See [guide](/gmt/guides/core-date-operations/leap-seconds-and-tai/), [mistakes](/gmt/mistakes/gnss/).

Start with the guide: [Maritime: GNSS Time and Week Rollover](/gmt/guides/industries/maritime-gnss-time-and-week-rollover/).

## Functions it draws on

### [`gnss`](/gmt/reference/gnss/)

Part of the [GNSS](/gmt/industries/gnss/) industry layer.

**[convert](/gmt/reference/gnss/convert/)**

- [`gnssToUtc`](/gmt/reference/gnss/convert/gnssToUtc/): Convert a satellite system's time-scale string to a UTC instant string.
- [`gnssWeekToUtc`](/gmt/reference/gnss/convert/gnssWeekToUtc/): Convert a week number and time of week, as a receiver reports them, to a UTC instant string.
- [`rinexWeekToUtc`](/gmt/reference/gnss/convert/rinexWeekToUtc/): Convert a week number from a RINEX navigation file, and the seconds of that week, to a UTC instant string.
- [`utcToGnss`](/gmt/reference/gnss/convert/utcToGnss/): Convert a UTC instant to a satellite system's own time, as a time-scale string.
- [`utcToGnssWeek`](/gmt/reference/gnss/convert/utcToGnssWeek/): Return the week, time of week and era of a UTC instant on a satellite week counter.
- [`utcToRinexWeek`](/gmt/reference/gnss/convert/utcToRinexWeek/): Return the RINEX navigation-file week and seconds of week of a UTC instant.

### [`timescale`](/gmt/reference/timescale/)

**[calculate](/gmt/reference/timescale/calculate/)**

- [`leapSecondsBetween`](/gmt/reference/timescale/calculate/leapSecondsBetween/): Return how many leap seconds start between two UTC instants, signed.
- [`nextLeapSecond`](/gmt/reference/timescale/calculate/nextLeapSecond/): Return the first leap second after a UTC instant, as its UTC label `…T23:59:60Z`.
- [`taiMinusUtc`](/gmt/reference/timescale/calculate/taiMinusUtc/): Return TAI − UTC, in whole seconds, at a UTC instant.
- [`tcgMinusTt`](/gmt/reference/timescale/calculate/tcgMinusTt/): Return TCG − TT, in seconds, at a UTC instant.

**[convert](/gmt/reference/timescale/convert/)**

- [`fromJ2000Seconds`](/gmt/reference/timescale/convert/fromJ2000Seconds/): Convert seconds since J2000.0 on a time scale to a UTC instant string.
- [`fromJulianDate`](/gmt/reference/timescale/convert/fromJulianDate/): Convert a single Julian Date on a time scale to a UTC instant string.
- [`fromJulianDateParts`](/gmt/reference/timescale/convert/fromJulianDateParts/): Convert a two-part Julian Date on a time scale to a UTC instant string.
- [`fromModifiedJulianDate`](/gmt/reference/timescale/convert/fromModifiedJulianDate/): Convert a Modified Julian Date on a time scale to a UTC instant string.
- [`fromTAI`](/gmt/reference/timescale/convert/fromTAI/): Convert a TAI time-scale string to a UTC instant string.
- [`fromTai64n`](/gmt/reference/timescale/convert/fromTai64n/): Convert a TAI64, TAI64N or TAI64NA label in hex text to a UTC instant string.
- [`fromTCG`](/gmt/reference/timescale/convert/fromTCG/): Convert a Geocentric Coordinate Time string to a UTC instant string.
- [`fromTT`](/gmt/reference/timescale/convert/fromTT/): Convert a Terrestrial Time string to a UTC instant string.
- [`toJ2000Seconds`](/gmt/reference/timescale/convert/toJ2000Seconds/): Convert a UTC instant to seconds since J2000.0 on a time scale.
- [`toJulianDate`](/gmt/reference/timescale/convert/toJulianDate/): Convert a UTC instant to a single Julian Date on a time scale.
- [`toJulianDateParts`](/gmt/reference/timescale/convert/toJulianDateParts/): Convert a UTC instant to a two-part Julian Date `{ jd1, jd2 }` on a time scale, exact to the nanosecond.
- [`toModifiedJulianDate`](/gmt/reference/timescale/convert/toModifiedJulianDate/): Convert a UTC instant to a Modified Julian Date on a time scale.
- [`toTAI`](/gmt/reference/timescale/convert/toTAI/): Convert a UTC instant to a TAI time-scale string, `YYYY-MM-DDTHH:MM:SS[.fraction] TAI`.
- [`toTai64n`](/gmt/reference/timescale/convert/toTai64n/): Convert a UTC instant to its TAI64N label in the daemontools text form, `@` and 24 lowercase hex digits.
- [`toTCG`](/gmt/reference/timescale/convert/toTCG/): Convert a UTC instant to a Geocentric Coordinate Time string, `YYYY-MM-DDTHH:MM:SS[.fraction] TCG`.
- [`toTT`](/gmt/reference/timescale/convert/toTT/): Convert a UTC instant to a Terrestrial Time string, `YYYY-MM-DDTHH:MM:SS[.fraction] TT`.

**[format](/gmt/reference/timescale/format/)**

- [`formatCcsdsAsciiA`](/gmt/reference/timescale/format/formatCcsdsAsciiA/): Write an instant as a CCSDS ASCII Time Code A string (`YYYY-MM-DDThh:mm:ss.d…dZ`).
- [`formatCcsdsAsciiB`](/gmt/reference/timescale/format/formatCcsdsAsciiB/): Write an instant as a CCSDS ASCII Time Code B string (`YYYY-DDDThh:mm:ss.d…dZ`, day of year).

**[parse](/gmt/reference/timescale/parse/)**

- [`parseCcsdsAsciiA`](/gmt/reference/timescale/parse/parseCcsdsAsciiA/): Read a CCSDS ASCII Time Code A (`YYYY-MM-DDThh:mm:ss.d…dZ`) as an ISO 8601 UTC instant string.
- [`parseCcsdsAsciiB`](/gmt/reference/timescale/parse/parseCcsdsAsciiB/): Read a CCSDS ASCII Time Code B (`YYYY-DDDThh:mm:ss.d…dZ`, day of year) as an ISO 8601 UTC instant string in calendar form.

**[validate](/gmt/reference/timescale/validate/)**

- [`isLeapSecond`](/gmt/reference/timescale/validate/isLeapSecond/): Return true when a UTC instant string is one of the 27 inserted leap seconds.

## Guides

- [Maritime: GNSS Time and Week Rollover](/gmt/guides/industries/maritime-gnss-time-and-week-rollover/): How a ship's equipment carries time, why the log keeps UTC, when a satellite clock reading enters a record, and how long a receiver's week counter stays safe over a ship's service life.
