The constructor DateTime(const char *iso8601dateTime) claims to enable the creation of DateTime objects using an ISO8601 date time definition.
However, the constructor only works for iso datetimes of format:
"2000-01-01T00:00:00" that can be truncated from the right at an arbitrary position, e.g. the string "2000-01" leads to a valid result.
This can be seen from the constructor implementation in the code:
DateTime::DateTime(const char *iso8601dateTime) {
char ref[] = "2000-01-01T00:00:00";
memcpy(ref, iso8601dateTime, min(strlen(ref), strlen(iso8601dateTime)));
yOff = conv2d(ref + 2);
m = conv2d(ref + 5);
d = conv2d(ref + 8);
hh = conv2d(ref + 11);
mm = conv2d(ref + 14);
ss = conv2d(ref + 17);
}
(RTClib.cpp, line 369)
Other definitions (https://en.wikipedia.org/wiki/ISO_8601#Times) like times only, e.g. T18:00, do not work. It is necessary to always define a full date with year, month and day before a time can be specified. Further, the colon between hours and minutes is mandatory for the constructor to work correctly. This is not the case in the ISO standard.