Bug in translation from timedelta to timespec fixed
authorlaurent
Fri, 01 Apr 2011 17:23:04 +0200
changeset 594 120bc22302a1
parent 593 726f58cf97e3
child 595 6348c0110e0f
Bug in translation from timedelta to timespec fixed
targets/typemapping.py
--- a/targets/typemapping.py	Fri Apr 01 16:17:38 2011 +0200
+++ b/targets/typemapping.py	Fri Apr 01 17:23:04 2011 +0200
@@ -62,7 +62,7 @@
     "LREAL" :      _t(c_double),
     "TIME" :       _t(IEC_TIME, 
                       lambda x:td(0, x.s, x.ns/1000), 
-                      lambda t,x:t(x.seconds, x.microseconds*1000)),
+                      lambda t,x:t(x.days * 24 * 3600 + x.seconds, x.microseconds*1000)),
     } 
 
 SwapedEndianessTypeTranslator = {