Zerout23 Posted June 24, 2021 Share Posted June 24, 2021 I am able to display the time using a variable value component and using the expression FormatDateTime("%c",SysTime()) which displays the current system time but I would rather have the current UTC time displayed instead. Is it possible to do this considering the application would be used in different timezones? i.e. want it to display UTC time no matter where the program is opened around the world. Thank you. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted July 6, 2021 Share Posted July 6, 2021 You would have to have the user specify their timezone offset and then apply that to the display using simple math. So, if their offset is +8, you'd just adjust your time stamps by 8*3600. Technically you probably could retrieve the local timezone setting from the OS using either shellExecute() or better, use extern() to load in the windows DLL that handles time. These, however, are a bit more complicated to achieve and would require some research into the workings of Windows. For example, I found that you can do this to get the time zone from the command prompt: systeminfo | findstr /C:”Time Zone” which you might then be able to pipe to a local file that you could then read into DAQFactory using the file. functions. It would take a little experimentation but should be workable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.