I'm trying to understand the Logic of converting gps time ms to UTC. The gps time is already utc corrected in milliseconds from LIDAR
I'm not sure how to confirm if this is correct?
time_adj=capture_time + gps_correction = 1.3812925228868198e9
where gps_correction = 1e9
const gps_epoch = DateTime(1980, 1, 6)
unix2datetime(time_adj + datetime2unix(gps_epoch))
The result is Dates.DateTime("2023-10-14T04:22:02.886")
Is this correct way ?
This is correct, but in converting from GPS there are also leap seconds to consider. As of 2023, during the date you are calculating over, there have been 18 leap seconds over the years since 1980 (seconds between December 31 and January 1, not counted by UTC but counted by GPS time standards). So to get the correct value to the exact second if this matters, you also have to subtract 18:
unix2datetime(time_adj + datetime2unix(gps_epoch) - 18)
If the GPS date you start with is before 2017, there is a different adjustment number. See for example https://www.nist.gov/pml/time-and-frequency-division/time-realization/leap-seconds for more.