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

Method UtcToUnixTime

be/src/runtime/timestamp-value.inline.h:119–125  ·  view source on GitHub ↗

Interpret 'this' as a timestamp in UTC and convert to unix time. Returns false if the conversion failed ('unix_time' will be undefined), otherwise true.

Source from the content-addressed store, hash-verified

117/// Returns false if the conversion failed ('unix_time' will be undefined), otherwise
118/// true.
119inline bool TimestampValue::UtcToUnixTime(time_t* unix_time) const {
120 DCHECK(unix_time != nullptr);
121 if (UNLIKELY(!HasDateAndTime())) return false;
122
123 *unix_time = DaysSinceUnixEpoch() * SECONDS_PER_DAY + time_.total_seconds();
124 return true;
125}
126
127/// Interpret 'this' as a timestamp in UTC and convert to unix time in microseconds.
128/// Nanoseconds are rounded to the nearest microsecond supported by Impala. Returns

Callers 2

FloorToSecondsFunction · 0.80
cctz_utc_to_localFunction · 0.80

Calls

no outgoing calls

Tested by 1

FloorToSecondsFunction · 0.64