Skip to content

Commit 7580dae

Browse files
committed
fix issue #7
1 parent 823c2dc commit 7580dae

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

datemath/helpers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def parseTime(timestamp, timezone='UTC'):
144144
'''
145145
if timestamp and len(timestamp) >= 4:
146146
ts = arrow.get(timestamp)
147-
ts = ts.replace(tzinfo=tz.gettz(timezone))
147+
ts = ts.replace(tzinfo=timezone)
148148
return ts
149149

150150

@@ -167,10 +167,7 @@ def calculate(now, offsetval, unit):
167167
if unit not in ('days','hours','seconds'):
168168
offsetval = int(offsetval)
169169
try:
170-
if sys.version_info[0] < 3:
171-
now = now.replace(**{unit: offsetval})
172-
else:
173-
now = now.shift(**{unit: offsetval})
170+
now = now.shift(**{unit: offsetval})
174171
if debug: print("Calculate called: now: {}, offsetval: {}, offsetval-type: {}, unit: {}".format(now, offsetval, type(offsetval), unit))
175172
return now
176173
except Exception as e:

0 commit comments

Comments
 (0)