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
def time(self):
value = self.obj.Value - int(self.obj.Value)
h = 24 * value
hours = int(h)
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)
seconds = self.obj.Value * SECONDS_DAY
time_delta = datetime.timedelta(seconds=seconds)
time = (datetime.datetime.min + time_delta).time()
return time
@property