usdot-jpo-ode / jpo-geojsonconverter

3 stars 6 forks source link

Fixed Issue with generating UTC timestamps when Hour rolls over #35

Closed John-Wiens closed 1 year ago

John-Wiens commented 1 year ago

The generateOffsetUTCTimestamp function will incorrectly generate a UTC timestamp for a corresponding time mark when the time in the SPaT message is near the hour mark. This change checks to see if the SPaT is close to the hour (10 minutes) and the timeMark is suitably small that it is likely in the next hour (first 10 minutes). If so, the time is shifted so that the UTC time representing the hour is in the next hour instead of the current hour. This ensures that the timeChangeDetailsEvents in the SPaT message are in the future and not in the past.