Do you have a variety of dates/times being used as was suggested?
As I posted earlier, having cases that failed with the current implementation and work when switching to gmtime_r() is good.
Is the current code pushed to the MR? Post the MR URL for everyone to look at.