I'm trying to get the time in a different timezone (PST) using C++.

#define PST (-8);
char* Time::getSecondSystemTime() {
    time_t rawtime;
    struct tm * timeinfo;
    char buffer[80];

    time(&amp;rawtime);
    timeinfo = gmtime(&amp;rawtime);

    timeinfo-&gt;tm_hour = timeinfo-&gt;tm_hour + PST;

    strftime(buffer, 80, "%I:%M %p", timeinfo);


    std::string temp = std::string(buffer); // to get rid of extra stuff
    std::string extraInfo = " Pacific Time ( US &amp; Canada )";

    temp.append(extraInfo);

    return (char*) (temp.c_str());

}


The problem here is that when the GMT time is less than 8 hours (for example, right now, the time there is 3AM in the morning), subtracting 8 hours from it does not work!

What is the proper way to get time at a different time zone in Unix?


Question: Why is my Display Controller Intel when I have nvidia graphics card?
Answer: So I found the issue, the GTX 660 cards are just having fickle support currently for anything outside of 12.04LTS. Furthermore, I thought that "display adapter" was what my OS was using for graphics, but seeing as how I am plugged directly into my graphics card, and it is clearly displayed as "VGA Controller", that is what's being used.

Problem: Display adapter &amp; VGA Controller showing 2 different sources.
Answer: running lspci | grep VGA clearly shows the card being utilized.

Recommend anyone with 600 series cards sticking with 12LTS for better support.