I\'m looking for something that I presumed would be very simple - given local Unix time in a specific time zone (specified as a string, e.g., \"America/New_York\" - note tha
Why can't you use the gmtime_r()? Following worked fine for me:
gmtime_r()
int main() { time_t t_gmt, t_local=time(NULL); struct tm tm_gmt; gmtime_r(&t_local, &tm_gmt); t_gmt = mktime(&tm_gmt); printf("Time now is: %s", ctime(&t_local)); printf("Time in GMT is: %s", ctime(&t_gmt)); return 0; }