We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f402893 commit d5798eeCopy full SHA for d5798ee
src/modm/math/calendar/date_time.hpp
@@ -219,11 +219,13 @@ class DateTime
219
static consteval DateTime
220
fromBuildTime()
221
{
222
- // Example: "Mon Dec 23 17:45:35 2024"
+ // Example: "Mon Dec 23 17:45:35 2024" or "Wed Jan 1 14:16:06 2025"
223
const std::string_view timestamp{__TIMESTAMP__};
224
+
225
const auto to_uint = [=](uint8_t offset, uint8_t length) -> uint16_t
226
- const auto str = timestamp.substr(offset, length);
227
+ auto str = timestamp.substr(offset, length);
228
+ if (str[0] == ' ') str = timestamp.substr(offset+1, length-1);
229
int integer;
230
(void) std::from_chars(str.begin(), str.end(), integer);
231
return uint16_t(integer);
0 commit comments