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

Function GetDayOfWeek

runtime/standard/time_functions.cc:122–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122Value GetDayOfWeek(absl::Time timestamp, absl::string_view tz) {
123 return GetTimeBreakdownPart(
124 timestamp, tz, [](const absl::TimeZone::CivilInfo& breakdown) {
125 absl::Weekday weekday = absl::GetWeekday(breakdown.cs);
126
127 // get day of week from the date in UTC, zero-based, zero for Sunday,
128 // based on GetDayOfWeek CEL function definition.
129 int weekday_num = static_cast<int>(weekday);
130 weekday_num = (weekday_num == 6) ? 0 : weekday_num + 1;
131 return weekday_num;
132 });
133}
134
135Value GetHours(absl::Time timestamp, absl::string_view tz) {
136 return GetTimeBreakdownPart(timestamp, tz,

Callers 1

Calls 1

GetTimeBreakdownPartFunction · 0.85

Tested by

no test coverage detected