Hi,
I am trying to get the system time from RTC APIs
The API "qapi_Core_RTC_GPS_Epoch_Get" is always returning value "294". The API "qapi_Core_RTC_Set" is giving out error "-6", which I guess is "QAPI_ERR_BUSY".
I am trying to sync up the time from SNTPC to RTC and read the current time in Epoch format.
Kindly help on this.
Regards,
Jagan
Kindly confirm if you are using below sequenctial flow to verify the time from SNTP to RTC and read in Epoch format:
> Connect to AP and acquire IP address
> Start DNS and SNTP client services
> Read UTC time from SNTP client. RTC and Epoch time.
Example using QCLI_demo to verify locally:
Thanks Raja.
There was a missing step/bug in my code, because of which the date & time was shown incorrect.
I corrected the same. I am getting correct date & time with the API
"qapi_Core_RTC_Get()". - "17-1-2020 4 5:50:48"
But with API "qapi_Core_RTC_GPS_Epoch_Get()" I am getting wrong value. For the same instant the API returns - 1263275448673
This epoch time refers to "Tuesday, 12 January 2010 05:50:48.673". This is nearly a decode old data & time.
Also the epoch millisecond time that is printed in your log is looks different. The value refers to "Sunday, 25 May 1986 19:28:34" as per the website https://www.epochconverter.com/
Jagan