Hello,
I'm developing on an EKS-lm4f232 and trying to keep track of the date and time using the included RTC. I query the user for a date and time (MM/DD/YY HH:MM:SS), parse their string to make sure it's sensible and then fill out a tm structure with their information (http://www.cplusplus.com/reference/ctime/tm/).
Ideally, I'd like to restrict the user to only entering GMT time. Obviously, they can choose to enter whatever they please, but this leads me to my question. I take the filled in tm structure, use mktime to get a time_t to seed my RTC with, and then use localtime to print out the date and time they've entered. When I use localtime, I get back exactly the date and time the user has entered (ideal), but when I use gmtime to do the same thing, the hours field gets adjusted even when the inputted time is, in fact, GMT. It seems logical that, if I want to keep track of GMT, I should use the gmtime function, but this behavior is confusing me. I don't see a timezone field in struct tm that I can adjust. Can anyone help me understand what's going on here?
-David
eks-lm4f232