Where does DAQFactory get its time from?


Rodney
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share