2015-04-13, 17:44
This may be a stupid question, but:
This works on Windows:
td = (datetime.datetime.utcnow()- datetime.datetime(1970,1,1))
unow = td.total_seconds()
same code does NOT on Android - it throws the following error:
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'.
Reading the python docs, total_seconds() is available in python 2.7 and above.
I had xbmc.python="2.1.0" when I first tested above, so I set xbmc.python="2.14.0" which according to the kodi docs is ok for Helix. It still works on Windows, but throws the same error on Android. I'm running 14.2 Helix when testing both Windows and Android.
So, I kinda have two questions:
1) Why doesn't this work on Android?
2) Why does this work on Windows when xbmc.python="2.1.0" is set?
Thanks
For those interested, ended up using this workaround:
unow = int((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6)
This works on Windows:
td = (datetime.datetime.utcnow()- datetime.datetime(1970,1,1))
unow = td.total_seconds()
same code does NOT on Android - it throws the following error:
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'.
Reading the python docs, total_seconds() is available in python 2.7 and above.
I had xbmc.python="2.1.0" when I first tested above, so I set xbmc.python="2.14.0" which according to the kodi docs is ok for Helix. It still works on Windows, but throws the same error on Android. I'm running 14.2 Helix when testing both Windows and Android.
So, I kinda have two questions:
1) Why doesn't this work on Android?
2) Why does this work on Windows when xbmc.python="2.1.0" is set?
Thanks
For those interested, ended up using this workaround:
unow = int((td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6)