Converting Log File GMS/GWk to correct UTC

I am confused how to get the correct UTC time from my flight logs.

Mission Planner displays the UTC time “2021-03-29 13:53:27.000” for GMS = 150825000 and GWk = 2151.

When I try to manually convert the GMS and GWk using python (see code below) I get “2021-03-29 17:53:08
Code Used: pandas.to_datetime(“1980-01-06 00:00:00”)+pandas.Timedelta(weeks=2151)+pandas.Timedelta(seconds=150825)-pandas.Timedelta(seconds=37)

I used an online converter to check my code and got the same answer minus the leap second correction: “2021-03-29 17:53:45”.

My flight was around 13:53, so Mission Planner is correct. I am confused at how to properly convert the provided GPS time into UTC. What am I missing? Where does Mission Planner get the times in the “-1” column?

Update: I realized my conversions failed to include the time zone! My calculations were outputting UTC and MP was outputting local time based on GPS data. All of my calculations were off by 03 hours, 59 minutes, and 41 seconds. I am guessing the additional discrepancy comes from the inclusion of leap seconds and any delays in logging. Does anyone have a concrete answer for the origin of the 19 second difference once I account for time zones?

You will find some answer here :