Hi Michael,
What is the time policy used in cothread to retrieve ioc time stamp?
I am using cothread 2.3, and found the time is shifted by a constant value relative to local timezone.
For example, in US EST time, to get time stamp in Python, I use val = caget(pv, format=FORMAT_TIME).
However, the time.localtime(val.timestamp)=real local time + 5 hours, and
time.gmtime(val.timestamp) = real local time + 10 hours = real UTC time + 5 hours,
which looks shifting to wrong direction.
Here is my test case:
$ caget -d 20 test
test
Native data type: DBF_DOUBLE
Request type: DBR_TIME_DOUBLE
Element count: 1
Value: 1.9
Timestamp: 2012-02-10 15:27:21.645387
Status: NO_ALARM
Severity: NO_ALARM
$ python
...
>>> from cothread.catools import *
>>> import time
>>> v=caget('test', format=FORMAT_TIME)
>>> time.localtime(v.timestamp)
time.struct_time(tm_year=2012, tm_mon=2, tm_mday=10, tm_hour=20, tm_min=27, tm_sec=21, tm_wday=4, tm_yday=41, tm_isdst=0)
>>> time.gmtime(v.timestamp)
time.struct_time(tm_year=2012, tm_mon=2, tm_mday=11, tm_hour=1, tm_min=27, tm_sec=21, tm_wday=5, tm_yday=42, tm_isdst=0)
Any suggestion?
Guobao