Conversion from struct tm to time_t with user introduced system offset?
Currently I am attempting to convert a GMT time to a time_t value by first populating a tm struct and calling the _mkgmtime function. The problem I am running into is that if the user has manually adjusted their system time, for example, advanced their system clock by 5 minutes through the "Change date and time settings..." menu, the _mkgmtime function will adjust for this 5 minutes. The GMT time is being provided by a GPS and ultimately I want to convert this to seconds since epoch, but all the conversion functions I have tried so far will account for an arbitrary system clock offset.
Also interesting, calling the _ftime* functions will return a time_t value that does not include a system offset, but as soon as you convert this function to a tm struct, (ie, via gmtime or similar) this offset is inserted.
The system is Windows 7, VS2012, C++ compiler.
If anyone has any ideas on how I can perform this conversion or work around a user induced system offset I would be much appreciated.