We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5e1adc commit 68f695dCopy full SHA for 68f695d
src/tools/datetools.js
@@ -19,12 +19,13 @@ function leapSecondsTAI (year, month) {
19
20
export default function extractStartTime (msgs) {
21
for (const i in msgs.time_boot_ms) {
22
- if (msgs.GWk[i] > 1000) { // lousy validation
+ if (msgs.GWk[i] > 2000) { // lousy validation
23
const weeks = msgs.GWk[i]
24
const ms = msgs.GMS[i]
25
let d = new Date((315964800.0 + ((60 * 60 * 24 * 7) * weeks) + ms / 1000.0) * 1000.0)
26
// adjusting for leap seconds
27
d = new Date(d.getTime() - leapSecondsGPS(d.getUTCFullYear(), d.getUTCMonth() + 1) * 1000)
28
+ console.log(d)
29
return d
30
}
31
0 commit comments