Esempio n. 1
0
String GetTimeZoneText()
{
	Time gmtime = GetUtcTime();
	Time ltime = GetSysTime();
	int d = (int)(ltime - gmtime) / 600;
	return Format("+%02.2d%01.1d0", d / 6, d % 6);
}
Esempio n. 2
0
int GetTimeZone()
{
	static int zone;
	ONCELOCK {
		for(;;) { // This is somewhat ugly, but unified approach to get time zone offset
			Time t0 = GetSysTime();
			Time gmtime = GetUtcTime();
			Time ltime = GetSysTime();
			if(GetSysTime() - t0 < 1) { // Make sure that there is not much time between calls
				zone = (int)(ltime - gmtime) / 60; // Round to minutes
				break;
			}
		}
	}
	return zone;
}
INT64 TimeDriver::GetLocalTime()
{
    return (GetUtcTime() + m_timezoneOffset);
}