Change algorit for get time from cell

This commit is contained in:
Mauricio Baeza 2020-10-02 13:48:59 -05:00
parent 524eb06749
commit 01dab4e416
1 changed files with 3 additions and 9 deletions

View File

@ -1104,15 +1104,9 @@ class LOCalcRange(object):
@property @property
def time(self): def time(self):
value = self.obj.Value - int(self.obj.Value) seconds = self.obj.Value * SECONDS_DAY
h = 24 * value time_delta = datetime.timedelta(seconds=seconds)
hours = int(h) time = (datetime.datetime.min + time_delta).time()
m = round((h - hours) * 60, 6)
minutes = int(m)
s = (m - minutes) * 60
seconds = int(s)
ms = int(round((s - seconds), 6) * 1_000_000)
time = datetime.time(hours, minutes, seconds, ms)
return time return time
@property @property