Skip to content

utcToGnssWeek

  • Satellite navigation time for any receiver: the six system times, week numbers and their rollovers, and RINEX navigation weeks.
utcToGnssWeek(counter: GnssWeekCounter, utcString: string): GnssWeek | null

Return the week, time of week and era of a UTC instant on a satellite week counter.

  • The inverse of gnssWeekToUtc: week is what the counter shows, era how often it has wrapped.
  • Time of week is a number of 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.
  • null before 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.
ParameterTypeDescription
counterGnssWeekCounterthe week counter: “GPS-LNAV”, “GPS-CNAV”, “GAL”, “BDT”, “QZS-LNAV”, “QZS-CNAV”, “IRN-LNAV” or “IRN-L1NV”
utcStringstringISO 8601 instant string; a listed leap second is accepted

{ week, timeOfWeekSeconds, era }, or null on invalid input, before the system’s epoch or past year 9999

A week and time of week on one satellite week counter.

import type { GnssWeek } from "@northguild/gmt";
MemberTypeDescription
weeknumberThe week number as the counter shows it, from 0 to the counter’s modulus − 1.
timeOfWeekSecondsnumberSeconds since the start of the week, from 0 up to but not including 604 800.
eranumberHow many times the counter has wrapped since the system’s epoch.
import { utcToGnssWeek } from "@northguild/gmt/gnss/convert";
utcToGnssWeek("GPS-LNAV", "2019-04-07T00:00:00Z") // { week: 0, timeOfWeekSeconds: 18, era: 2 }
output 

gnss/convert/utcToGnssWeek.ts

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.