Where does DAQFactory get its time from?


Rodney

Recommended Posts

Hi

I understand DAQFactory's time is much more precise than pc time and it starts in 1970 etc etc

My question relates to how DF treats a windows clock change / daylight saving change

If the PC's clock is updated using an NTP server on a regular basis - how does this affect the DF time?

the pc clock is currently drifting up to 2 seconds a day and is corrected on a regular basis (I currently have updates set to twice a day)

Rodney

 

 

 

Link to comment
Share on other sites

See this post:

Be careful with DST.  It can cause your loops to hang for an hour if the loop happens to be sleeping when the clock is set backwards.  Also, and perhaps more importantly, you'll end up with an hours worth of data with a time stamp that is the same as the previous hour's.

 

Link to comment
Share on other sites

on re-reading the post it appears that 9 years later systime() is actually UTC time adjusted for your local timezone WITHOUT any DST adjustment

all time stamps are held using this systime and if you wish to allow for DST you can just use the formula you provided by checking the DST flag and adjusting accordingly

this way the timestamps are never altered

can you please confirm my interpretation

on another minor issue it appears that I cannot display the date in dd/mm/yy format using the formatdatetime %c specifier - it will only display mm/dd/yy

here in Australia dd/mm/yy is the convention - I have checked all my windows regional locale etc settings and believe they are correct - is this a minor known bug or have I missed something?

Link to comment
Share on other sites

No, systime() is local time based on whatever time it is locally when you start DAQFactory.  So if you are in DST when you start DAQFactory then systime() will be in DST.  DAQFactory won't switch out of DST, however, if it is running at the time of the switch.

As for the %c issue, that is a Windows issue as we pass the format specifiers directly to an internal Windows function that does the formatting.  You can always just create your own format using the other specifiers, for example: "%d/%m/%y %H:%M:%S"

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.