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: Migration Assistant fails on Ethernet Mavericks-to-Mavericks migration
Answer: Here are the points which don't block Migration Assistant on the source Mac side:

Firewall on

File Sharing off

FileVault on


Here are 2 key points which blocks the reachability of Migration Assistant on the source Mac side:

IPv6

IPv6 off


This isn't the default configuration. But within enterprise large networks it
is a usefull practice to avoid IPv6 problems when your infrastructure and
your other computers don't manage it yet.

If IPv6 is off on the source Mac, just turn it on before firing the installation process from the target Mac.

Firewall setting

If your firewall setting on the source Mac is set so that it won't automatically accept connection from signed software (as in this screen capture)


then "Migration Assistant" will fail (the connection will fail, and the source Mac won't display the code to confirm it is the right source).

You just have to turn this switch on before firing the installation process from the target Mac.
Of course, this setting won't be correctly transfered by the Migration Assistant since it would block it.

Beware if you want to make different tests!

Once the source Mac has been seen on the network (or direct connection) any configuration change on the source side won't be seen on the target side.

To see any configuration change of the source side the installation process of the target side must be restarted at the boot step from 
disk.

The back button isn't sufficient.

The Migration Assistant on the source Mac can detect this failure factor and could warn us that it will fail with a clear warning window
rather than to play with the rotating gearing.