1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: cothread time stamp problem |
From: | <[email protected]> |
To: | <[email protected]> |
Cc: | [email protected] |
Date: | Mon, 13 Feb 2012 13:38:11 +0000 |
Hi Guobao, I’ve looked into the code and I think I’ve made a horrible mistake. Can you try the following patch and let me know if it fixes things for you: diff --git a/cothread/dbr.py b/cothread/dbr.py Of course, the problem is that: 1.
EPICS timestamps are in UTC, as they ought to be 2.
The mktime() function is localised, so I shouldn’t have used it 3.
The correct function, timegm(), is less widely known (a GNU extension to libc, for example) 4.
At Diamond our time zone is GMT which is at most one hour away from UTC 5.
I have a horrible feeling I’ve only looked closely at timestamps during the winter (when GMT=UTC) 6.
oops Do you have any more bugs in the pipeline? I’m looking hard now! I’ve pushed this patch to git, but will hold off on a release for a few days yet. From: Shen, Guobao [mailto:[email protected]]
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:
-- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. |