I can printout time in UTC and local time like this:
time_t now;
struct tm ts, tm;
char buf[80];
now = time(NULL);
ts = *gmtime(&now);
tm = *localtime(&now);
strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", &ts);
printf("%s\n", buf);
strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", &tm);
printf("%s\n", buf);
But how do I printout time in a specified timezone that is different than UTC or my current timezone? Also, would it be OS/distro dependent?