How to access system time

How to access system time
none 0.0 0

I’m trying to get system time using SysTimeRTCHighResGet function from SysTimeRTC library, but getting 0 returned. How do I get local time, that I can use in the program?

To get the local time in your program, we recommend using the following approach:

  • Use SysTimeRtcGet to retrieve the system time in DWORD format.
  • Then, convert this DWORD system time to a readable date and time format (year, month, day, hour, minute, second, microsecond) using SysTimeRtcConvertUtcToDate.
  • If you need to convert a date and time structure back to DWORD format, use SysTimeRtcConvertDateToUtc

For more information on HMI system times here is a resource:Demo Project

Thank you. It works with SysTimeRtcGet function.

1 Like