Category: Date and time
CONVERT_TIME_ZONE_FROM_UTC
CONVERT_TIME_ZONE_FROM_UTC converts a UTC timestamp to another time zone such as Europe/Berlin.
Syntax
CONVERT_TIME_ZONE_FROM_UTC(inputTime, 'timeZone')AMC specifics
- The time zone is given as a tz database name. The input can be a TIMESTAMP or DATE; the result has the same type.
- To state the source zone yourself use CONVERT_TIME_ZONE(inputTime, sourceTimeZone, destinationTimeZone).
Example
Conversions by time of day in Berlin instead of UTC.
SELECT
EXTRACT(HOUR FROM CONVERT_TIME_ZONE_FROM_UTC(event_dt_utc, 'Europe/Berlin')) AS hour_berlin,
SUM(conversions) AS conversions
FROM
conversions
GROUP BY
1 Checked against the AMC schema, not executed on an AMC instance.