utcToGnssWeek
Signature
Section titled “Signature”utcToGnssWeek(counter: GnssWeekCounter, utcString: string): GnssWeek | nullReturn the week, time of week and era of a UTC instant on a satellite week counter.
- The inverse of
gnssWeekToUtc:weekis what the counter shows,erahow often it has wrapped. - Time of week is a
numberof seconds; a fraction is the nearest double to the exact value. - A listed leap second (
…T23:59:60Z) falls in its own second of the week. nullbefore the system’s epoch, for an instant past 9999-12-31T23:59:59.999999999Z (the inverse writes four-digit years only), and on invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
counter | GnssWeekCounter | the week counter: “GPS-LNAV”, “GPS-CNAV”, “GAL”, “BDT”, “QZS-LNAV”, “QZS-CNAV”, “IRN-LNAV” or “IRN-L1NV” |
utcString | string | ISO 8601 instant string; a listed leap second is accepted |
Returns
Section titled “Returns”{ week, timeOfWeekSeconds, era }, or null on invalid input, before the system’s epoch or past year 9999
GnssWeek
Section titled “GnssWeek”A week and time of week on one satellite week counter.
import type { GnssWeek } from "@northguild/gmt";| Member | Type | Description |
|---|---|---|
week | number | The week number as the counter shows it, from 0 to the counter’s modulus − 1. |
timeOfWeekSeconds | number | Seconds since the start of the week, from 0 up to but not including 604 800. |
era | number | How many times the counter has wrapped since the system’s epoch. |
Related types
Section titled “Related types”Examples
Section titled “Examples”import { utcToGnssWeek } from "@northguild/gmt/gnss/convert";
utcToGnssWeek("GPS-LNAV", "2019-04-07T00:00:00Z") // { week: 0, timeOfWeekSeconds: 18, era: 2 }Source
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.