| 40 | i32 GMTOff = 0; |
| 41 | |
| 42 | TTimeData(time_t t) { |
| 43 | struct ::tm tt; |
| 44 | ::localtime_r(&t, &tt); |
| 45 | #ifndef _win_ |
| 46 | GMTOff = tt.tm_gmtoff; |
| 47 | #else |
| 48 | TIME_ZONE_INFORMATION tz; |
| 49 | switch (GetTimeZoneInformation(&tz)) { |
| 50 | case TIME_ZONE_ID_UNKNOWN: |
| 51 | GMTOff = tz.Bias * -60; |
| 52 | break; |
| 53 | case TIME_ZONE_ID_STANDARD: |
| 54 | GMTOff = (tz.Bias + tz.StandardBias) * -60; |
| 55 | break; |
| 56 | case TIME_ZONE_ID_DAYLIGHT: |
| 57 | GMTOff = (tz.Bias + tz.DaylightBias) * -60; |
| 58 | break; |
| 59 | default: |
| 60 | break; |
| 61 | } |
| 62 | #endif |
| 63 | IsDst = tt.tm_isdst; |
| 64 | } |
| 65 | }; |
| 66 | |
| 67 | TSimpleTM TSimpleTM::CurrentUTC() { |
nothing calls this directly
no test coverage detected