MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / GetTimeBreakdownPart

Function GetTimeBreakdownPart

runtime/standard/time_functions.cc:73–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73Value GetTimeBreakdownPart(
74 absl::Time timestamp, absl::string_view tz,
75 const std::function<int64_t(const absl::TimeZone::CivilInfo&)>&
76 extractor_func) {
77 absl::TimeZone::CivilInfo breakdown;
78 auto status = FindTimeBreakdown(timestamp, tz, &breakdown);
79
80 if (!status.ok()) {
81 return ErrorValue(status);
82 }
83
84 return IntValue(extractor_func(breakdown));
85}
86
87Value GetFullYear(absl::Time timestamp, absl::string_view tz) {
88 return GetTimeBreakdownPart(timestamp, tz,

Callers 10

GetFullYearFunction · 0.85
GetMonthFunction · 0.85
GetDayOfYearFunction · 0.85
GetDayOfMonthFunction · 0.85
GetDateFunction · 0.85
GetDayOfWeekFunction · 0.85
GetHoursFunction · 0.85
GetMinutesFunction · 0.85
GetSecondsFunction · 0.85
GetMillisecondsFunction · 0.85

Calls 4

FindTimeBreakdownFunction · 0.85
ErrorValueFunction · 0.85
IntValueClass · 0.50
okMethod · 0.45

Tested by

no test coverage detected