| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #include "src/vm/platform.h" | 5 #include "src/vm/platform.h" |
| 6 | 6 |
| 7 #include <time.h> | 7 #include <time.h> |
| 8 | 8 |
| 9 namespace fletch { | 9 namespace fletch { |
| 10 | 10 |
| 11 int Platform::GetLocalTimeZoneOffset() { | 11 int Platform::GetLocalTimeZoneOffset() { |
| 12 // TODO(ajohnsen): avoid excessive calls to tzset? | 12 // TODO(ajohnsen): avoid excessive calls to tzset? |
| 13 tzset(); | 13 tzset(); |
| 14 // Even if the offset was 24 hours it would still easily fit into 32 bits. | 14 // Even if the offset was 24 hours it would still easily fit into 32 bits. |
| 15 // Note that Unix and Dart disagree on the sign. | 15 // Note that Unix and Dart disagree on the sign. |
| 16 return static_cast<int>(-timezone); | 16 return static_cast<int>(-timezone); |
| 17 } | 17 } |
| 18 | 18 |
| 19 } // namespace fletch | 19 } // namespace fletch |
| 20 | |
| 21 | |
| OLD | NEW |