MCPcopy Create free account
hub / github.com/bytedance/bolt / castFromDateString

Function castFromDateString

bolt/type/TimestampConversion.cpp:800–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800std::optional<int32_t>
801castFromDateString(const char* str, size_t len, bool isIso8601) {
802 int64_t daysSinceEpoch;
803 size_t pos = 0;
804
805 auto mode =
806 isIso8601 ? ParseMode::kStandardCast : ParseMode::kNonStandardCast;
807 auto result = tryParseDateString(str, len, pos, daysSinceEpoch, mode);
808 if (result != DateParseResult::kSuccess) {
809 return std::nullopt;
810 }
811 return daysSinceEpoch;
812}
813
814int32_t extractISODayOfTheWeek(int32_t daysSinceEpoch) {
815 // date of 0 is 1970-01-01, which was a Thursday (4)

Callers

nothing calls this directly

Calls 1

tryParseDateStringFunction · 0.85

Tested by

no test coverage detected