absl::ParseLenientCivilTime

Parses any of the formats accepted by absl::ParseCivilTime(). Unlike ParseCivilTime(), the input string format does not need to match the target civil-time type. Discrepancies are resolved as follows: * Extra components in the input string are ignored. * Missing components are defaulted to their minimum valid values. This behavior is consistent with civil-time converting constructors.

Synopses

Declared in <absl/time/civil_time.h>

bool
ParseLenientCivilTime(
    std::string_view s,
    CivilDay* c);
» more...
bool
ParseLenientCivilTime(
    std::string_view s,
    CivilHour* c);
» more...
bool
ParseLenientCivilTime(
    std::string_view s,
    CivilMinute* c);
» more...
bool
ParseLenientCivilTime(
    std::string_view s,
    CivilMonth* c);
» more...

Parses any of the formats accepted by absl::ParseCivilTime(). Unlike ParseCivilTime(), the input string format does not need to match the target civil-time type. Discrepancies are resolved as follows: * Extra components in the input string are ignored. * Missing components are defaulted to their minimum valid values. This behavior is consistent with civil-time converting constructors.

bool
ParseLenientCivilTime(
    std::string_view s,
    CivilSecond* c);
» more...
bool
ParseLenientCivilTime(
    std::string_view s,
    CivilYear* c);
» more...

Return Value

true upon successful parsing.

Parameters

NameDescription
sThe string to parse.
cOutput parameter receiving the parsed civil-time value.