नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime 13.3 LTS and above
Converts TIMESTAMP_NTZ to another time zone.
The input column is converted to TIMESTAMP_NTZ type before the time zone conversion, if the input column is of TIMESTAMP or DATE or STRING type.
Syntax
convert_timezone([sourceTz, ]targetTz, sourceTs)
Arguments
sourceTz: An expression that returns a numeric or an interval value. If absent, the current session time zone is used as the source time zone.targetTz: The time zone to which the input timestamp should be converted.sourceTs: TheTIMESTAMP_NTZto convert.
Returns
A TIMESTAMP_NTZ.
Examples
> SELECT convert_timezone('America/Los_Angeles', 'UTC', timestamp_ntz'2021-12-06 00:00:00');
2021-12-06 08:00:00
-- Current session local timezone: UTC
> SELECT convert_timezone('America/Los_Angeles', timestamp_ntz'2021-12-06 08:00:00');
2021-12-06 00:00:00