Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Creates a timestamp with a local time zone from date and time fields.
Syntax
make_timestamp_ltz(year, month, day, hour, min, sec [, timezone] )
make_timestamp_ltz(date, time [, timezone] )
Important
The time argument uses the TIME data type, which is in Beta.
Arguments
year: AnINTEGERexpression from1through9999.month: AnINTEGERexpression from1(January) through12(December).day: AnINTEGERexpression from1through31.hour: AnINTEGERexpression from0through23.min: AnINTEGERexpression from0through59.sec: A numeric expression from0through60.date: ADATEexpression that provides the year, month, and day fields.time: ATIMEexpression that provides the hour, minute, and second fields.timezone: An optionalSTRINGexpression that evaluates to a valid time zone, such asCETorUTC.
Returns
If sec is 60, the function interprets it as 0 and adds one minute to the result.
If an argument is out of bounds, the function raises DATETIME_FIELD_OUT_OF_BOUNDS. Use try_make_timestamp_ltz to return NULL instead.
Common error conditions
Examples
> SELECT make_timestamp_ltz(2014, 12, 28, 6, 30, 45.887, 'CET');
2014-12-27 21:30:45.887
> SELECT make_timestamp_ltz(DATE'2014-12-28', TIME'06:30:45.887');
2014-12-28 06:30:45.887