Browse Source

Make DateTime::fromString() cope with 'T' separator

master
Martchus 6 months ago
parent
commit
e6e7a63d6a
  1. 3
      chrono/datetime.cpp

3
chrono/datetime.cpp

@ -93,7 +93,8 @@ DateTime DateTime::fromString(const char *str)
} else {
Detail::raiseAndAdd(*valueIndex, 10, c);
}
} else if ((c == '-' || c == ':' || c == '/') || (c == '.' && (valueIndex == secondsIndex)) || (c == ' ' && (valueIndex == dayIndex))) {
} else if ((c == '-' || c == ':' || c == '/') || (c == '.' && (valueIndex == secondsIndex))
|| ((c == ' ' || c == 'T') && (valueIndex == dayIndex))) {
if (++valueIndex == valuesEnd) {
break; // just ignore further values for now
}

Loading…
Cancel
Save