Skip to content

Commit 342907a

Browse files
committed
Merge branch 'develop'
* develop: updated ver no + changelog Fixed possible miscalculation of local machine's timezone
2 parents 2f6e2cd + a5b1dd4 commit 342907a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Release Notes
33

44
*September 25, 2017*
55

6+
1.5.76
7+
-----------
8+
- Fixed possible miscalculation of local machine's timezone (hotfix)
9+
610
1.5.75
711
-----------
812
- Futures spec is now downloading from `qtpylib.io <http://qtpylib.io/resources/futures_spec.csv>`_ (updated daily)

qtpylib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# limitations under the License.
2020
#
2121

22-
__version__ = '1.5.75'
22+
__version__ = '1.5.76'
2323
__author__ = 'Ran Aroussi'
2424

2525
from . import *

qtpylib/tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,11 @@ def after_third_friday(day=None):
439439
# =============================================
440440

441441
def get_timezone(as_timedelta=False):
442-
""" utility to get the machine's timeozone """
442+
""" utility to get the machine's timezone """
443443
try:
444-
offset_hour = -(datetime.datetime.now() - datetime.datetime.utcnow()).seconds
444+
offset_hour = -(time.altzone if time.daylight else time.timezone)
445445
except:
446-
offset_hour = time.altzone if time.daylight else time.timezone
446+
offset_hour = -(datetime.datetime.now() - datetime.datetime.utcnow()).seconds
447447

448448
offset_hour = offset_hour // 3600
449449
offset_hour = offset_hour if offset_hour < 10 else offset_hour // 10

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
setup(
2222
name='QTPyLib',
23-
version='1.5.75',
23+
version='1.5.76',
2424
description='Quantitative Trading Python Library',
2525
long_description=long_description,
2626
url='https://github.com/ranaroussi/qtpylib',

0 commit comments

Comments
 (0)