MCPcopy Create free account
hub / github.com/apache/impala / ToString

Function ToString

be/src/util/time.cc:101–109  ·  view source on GitHub ↗

Convert time point 't' into date-time string at precision 'p'. Output string is in UTC time zone if 'utc' is true, else it is in the local time zone.

Source from the content-addressed store, hash-verified

99// Output string is in UTC time zone if 'utc' is true, else it is in the
100// local time zone.
101static string ToString(const chrono::system_clock::time_point& t, TimePrecision p,
102 bool utc) {
103 stringstream ss;
104 time_t second = GetSecond(t);
105 int64_t subsecond = GetSubSecond(t, p);
106 ss << FormatSecond(second, subsecond, utc);
107 ss << FormatSubSecond(subsecond, p);
108 return ss.str();
109}
110
111// Convenience function to convert Unix time, specified as seconds since
112// the Unix epoch, into a C++ time_point object.

Callers 15

ToStringFromUnixMethod · 0.70
ToUtcStringFromUnixMethod · 0.70
ToStringMethod · 0.50
as_stringMethod · 0.50
CompileRegexFunction · 0.50
RegexpReplaceMethod · 0.50
ParseUrlPrepareMethod · 0.50
ParseUrlMethod · 0.50

Calls 5

GetSecondFunction · 0.85
GetSubSecondFunction · 0.85
FormatSecondFunction · 0.85
FormatSubSecondFunction · 0.85
strMethod · 0.45

Tested by

no test coverage detected