Commit 77ca65c9 authored by Robert Sebille's avatar Robert Sebille
Browse files

la méthode diffDays renvoie désormais ses résultats aussi en secondes

parent 786250ab
......@@ -139,6 +139,7 @@ _See « - operator » too_
return ts2 - self.ts1 in days, hours, minutes, seconds.
Offset UTC timestamp 1 must match offset UTC timestamp 2 and epoch timestamp 1 must match epoch timestamp 2.
Return typ =
- "seconds": return the number of seconds.
- "string": return a string (+/-DDTHH:MM:SS). Default.
- "list": return a list (fixed order).
fixed order: sens_difference, day, hour, minutes, seconds.
......
......@@ -238,6 +238,7 @@ class AaaaHorodatageTools(AaaaHorodatage):
and epoch timestamp 1 must match epoch timestamp 2.
Return typ =
- "seconds": return the number of seconds.
- "string": return a string (+/-DDTHH:MM:SS). Default.
- "list": return a list (fixed order).
fixed order: sens_difference, day, hour, minutes, seconds.
......@@ -291,6 +292,12 @@ class AaaaHorodatageTools(AaaaHorodatage):
heures = int((dts / (60 * 60)) % 24)
jours = int(dts / (60 * 60 * 24))
if typ == "seconds":
if sens_diff == "-":
retour = -dts
else:
retour = dts
if typ == "string":
retour = (sens_diff + str(jours) + "T" + str(heures) + ":" +
str(minutes) + ":" + str(secondes))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment