add tag

    #include <iostream>
    #include <iomanip>
    #include <cstdlib>
    #include <sstream>
    #include <chrono>
    int main()
        std::tm date{};
        std::istringstream ss("2021-05-1");
        ss >> std::get_time(&date, "%Y-%m-%d");
        std::cout << std::boolalpha << << '\n';

> true

On VS compiler output is:

> false

[Cppreference]( is saying that leading zeros are not requiring, is it bug in gcc or something else?
Top Answer
It's indeed an old bug in gcc - [Facet time_get not reading dates according to the IEEE 1003 standard](

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.