1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| #include <WiFi.h>
#include <time.h>
const char * ssid = "ssid";
const char * pw = "pass";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, pw);
while (WiFi.status() != WL_CONNECTED) delay(200);
configTime(0, 0, "pool.ntp.org", "time.nist.gov");
delay(1000);
time_t now;
time( & now);
Serial.println(ctime( & now));
}
void loop() {}
|