Parsing question

I need to parse “2017-02-02T17:44:52+00:00” into Hour, Min, Sec. and I’m stuck.

This was parsed from

This will be used with RTC so I can set sunset and turn on lights.

Check out sscanf()

Here is a little example I plucked for you to study.

  Serial.print("hour: ");   Serial.println(hh);
  Serial.print("minute: "); Serial.println(mm);
  Serial.print("second: "); Serial.println(ss);
  Serial.print("day: ");    Serial.println(DD);
  Serial.print("month: ");  Serial.println(MM);
Serial.print("year: "); Serial.println(YY);

I gave it a try and get, undefined reference to `sscanf’ when compiling.

Try this link

1 Like

Sscanf does not work with esp8266, any other idea’s?

Did you try os_scanf as per the first result in @Costas’s link?