หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Applies to:
Databricks SQL
Databricks Runtime
Converts a timestamp to a string in the format fmt.
Syntax
date_format(expr, fmt)
Arguments
expr: A DATE, TIMESTAMP, or a STRING in a valid datetime format.- fmt: A STRING expression describing the desired format.
Returns
A STRING.
See Datetime patterns for details on valid formats.
Examples
> SELECT date_format('2016-04-08', 'y');
2016