| 1312 | } |
| 1313 | |
| 1314 | void DateTime::AdjustToTimezone(TimeZone tz, bool noDST) noexcept |
| 1315 | { |
| 1316 | std::int32_t secDiff = Implementation::GetTimeZone() + tz.GetOffset(); |
| 1317 | std::int32_t bias = 0; |
| 1318 | |
| 1319 | // We are converting from the local time to some other time zone, but local time zone does not include the DST offset |
| 1320 | // (as it varies depending on the date), so we have to handle DST manually, unless a special flag inhibiting this was specified. |
| 1321 | if (!tz.IsLocal() && !noDST && Implementation::IsDST(*this, bias)) { |
| 1322 | secDiff -= bias; |
| 1323 | } |
| 1324 | |
| 1325 | _time += secDiff * 1000; |
| 1326 | } |
| 1327 | |
| 1328 | void DateTime::AdjustFromTimezone(TimeZone tz, bool noDST) noexcept |
| 1329 | { |
no test coverage detected