| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import calendar | 5 import calendar |
| 6 from datetime import datetime | 6 from datetime import datetime |
| 7 from datetime import time | 7 from datetime import time |
| 8 from datetime import timedelta | 8 from datetime import timedelta |
| 9 | 9 |
| 10 import pytz | 10 import pytz |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 naive_time(datetime): naive time in local time zone, for example '+0800'. | 89 naive_time(datetime): naive time in local time zone, for example '+0800'. |
| 90 | 90 |
| 91 Return: | 91 Return: |
| 92 A naive datetime object in utc time zone. | 92 A naive datetime object in utc time zone. |
| 93 For example: | 93 For example: |
| 94 For TimeZoneInfo('+0800'), and naive local time is | 94 For TimeZoneInfo('+0800'), and naive local time is |
| 95 datetime(2016, 9, 1, 10, 0, 0), the returned result should be | 95 datetime(2016, 9, 1, 10, 0, 0), the returned result should be |
| 96 datetime(2016, 9, 1, 2, 0, 0) in utc time. | 96 datetime(2016, 9, 1, 2, 0, 0) in utc time. |
| 97 """ | 97 """ |
| 98 return naive_time - self._utcoffset | 98 return naive_time - self._utcoffset |
| OLD | NEW |