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

Function GetDateTz

eval/public/extension_func_registrar.cc:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49CelValue GetDateTz(Arena* arena, absl::Time time_stamp,
50 absl::TimeZone time_zone) {
51 absl::Time ret_date;
52 absl::CivilDay normalized_date;
53 // convert absl time to civil day, which normalizes to midnight time,
54 // convert the result to CivilSecond
55 // convert CivilSecond from previous step back into absl::Time
56 normalized_date = absl::ToCivilDay(time_stamp, time_zone);
57 absl::CivilSecond normalized_date_cs(normalized_date);
58 ret_date = absl::FromCivil(normalized_date_cs, time_zone);
59 return CelValue::CreateTimestamp(ret_date);
60}
61
62CelValue GetDate(Arena* arena, absl::Time time_stamp,
63 absl::string_view time_zone) {

Callers 2

GetDateFunction · 0.85
GetDateUTCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected