Change algorit for get time from cell
This commit is contained in:
parent
524eb06749
commit
01dab4e416
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue