Skip to content

Commit

Permalink
constant ts
Browse files Browse the repository at this point in the history
  • Loading branch information
svm1 committed Jan 10, 2024
1 parent b2b023e commit 18fc051
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions velox/functions/prestosql/DateTimeFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,15 @@ struct TimestampAtTimezoneFunction : public TimestampWithTimezoneSupport<T> {
out_type<TimestampWithTimezone>& result,
const arg_type<TimestampWithTimezone>& tsWithTz,
const arg_type<Varchar>& timeZone) {

auto timeZoneStr = std::string_view(timeZone.data(), timeZone.size());
auto zone = date::locate_zone(timeZoneStr);
std::chrono::system_clock::time_point tp{
std::chrono::seconds{ts.getSeconds()}};

const auto inputMs = *timestampWithTimezone.template at<0>();
const auto inputTz = *timestampWithTimezone.template at<1>();
const auto inputMs = *tsWithTz.template at<0>();
const auto inputTz = *tsWithTz.template at<1>();

std::chrono::system_clock::time_point tp{
std::chrono::seconds{(inputMs/1000)}};

// We are to interpret the input timestamp as being at GMT;
// Africa/Abidjan has offset +00:00; use this timezone to establish GMT as
Expand Down

0 comments on commit 18fc051

Please sign in to comment.