And follow the tutorial to install the .zip library to Ameba: https://www.arduino.cc/en/Guide/Libraries#toc4
Open the sample code in “File” -> “Examples” -> “AmebaTime” -> “TimeNTP”
Please modify the sample code to provide the WiFi ssid/password information for WiFi connection. Then upload the sample to Ameba and press reset button.
In execution, the program first sends an NTP request to NTP server. When the response is received, the time library handles to time conversion.
First, to set the function to get time value for the Time library, specify the function pointer in setSyncProvider().
The function must return the unix time format (i.e., the total seconds from January,1,1970) with type time_t, which is in fact unsigned long type.
In getNtpTime(), we get the time from NTP server as in the AmebaWiFi example WiFiUdpNtpClient. Then do the timezone conversion. To get related time values, we can call these functions: year(), month(), day(), hour(), minute(), second()