Wajiduddaim
Junior Member level 1
- Joined
- May 12, 2011
- Messages
- 18
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- darbar-e-Sadria
- Activity points
- 1,464
hi
i m using esp32 and its wifi library in Arduino
After getting NTP time
when i Call this function everything fine
i want to get time separately like
LocalHour = timeinfo's Hours value
ect.
i tried some methods but they didnt work like
Localhour = timeinfo.tm_hour;
the result is 0 (Zero)
how can i get values
i m using esp32 and its wifi library in Arduino
After getting NTP time
when i Call this function everything fine
C++:
void printLocalTime()
{
struct tm timeinfo;
if (!getLocalTime(&timeinfo))
{
Serial.println("Failed to obtain time");
TimeSuccess = false;
return;
}
TimeSuccess = true;
Serial.println(&timeinfo, "%A, %d %B %Y %H:%M:%S");
}
i want to get time separately like
LocalHour = timeinfo's Hours value
ect.
i tried some methods but they didnt work like
Localhour = timeinfo.tm_hour;
the result is 0 (Zero)
how can i get values
Last edited: