TO_TIMESTAMP_NTZ
Description
The TO_TIMESTAMP_NTZ function is used to convert different types of datetime expressions (expr) into a timestamp (timestamp_ntz) type. If the fmt parameter is provided, the function will parse according to the specified format; if fmt is not provided, it will convert according to the default format. If the datetime format in expr is incorrect, the function will return null.
Parameter Description
- expr (string): The string expression to be converted.
- fmt (string, optional): Specifies the format of the datetime in the string expression.
Return Result
The converted timestamp (timestamp_ntz).
Examples
- Convert a string to a timestamp according to the specified format:
- If the time format matches yyyy-MM-dd HH:mm:ss.SSS, then there is no need to specify the string format