Skip to content

Commit 16df7a5

Browse files
authored
Merge pull request #68 from andreArtelt/dev
Several fixes regarding rules
2 parents f2e3c94 + 285a1c2 commit 16df7a5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

epyt/epanet.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
c_char_p
6565
from types import SimpleNamespace
6666
import matplotlib.pyplot as plt
67-
from datetime import datetime
67+
from datetime import datetime, timezone
6868
from epyt import __version__, __msxversion__, __lastupdate__
6969
from shutil import copyfile
7070
from matplotlib import cm
@@ -6078,7 +6078,7 @@ def getRules(self, *argv):
60786078
objectNameID = ' '
60796079
space = ''
60806080
if variable >= self.ToolkitConstants.EN_R_TIME:
6081-
value_premise = datetime.utcfromtimestamp(value_premise).strftime("%I:%M %p UTC")
6081+
value_premise = datetime.fromtimestamp(value_premise, tz=timezone.utc).strftime("%I:%M %p")
60826082
else:
60836083
value_premise = str(value_premise)
60846084
if status == 0:
@@ -10625,6 +10625,8 @@ def __controlSettings(self, value):
1062510625
else:
1062610626
time_ = splitControl[5].split(':')
1062710627
controlLevel = int(time_[0]) * 3600 + int(time_[1]) * 60
10628+
if splitControl.__len__() > 6 and "PM" == splitControl[6]:
10629+
controlLevel += 43200
1062810630
return [controlTypeIndex, linkIndex, controlSettingValue, nodeIndex, controlLevel]
1062910631

1063010632
def __createTempfiles(self, BinTempfile):

0 commit comments

Comments
 (0)