Cast functions and operators
Use the cast
function and operator to convert a value to a specific type.
Syntax
cast ( value AS type )
value :: type
Parameter | Description |
---|---|
value | The value to be converted. |
type | The data type of the returned value. For the types you can cast the value to, see Casting. |
Example
SELECT '2049-01-01 23:34:56+08:00'::timestamp with time zone::varchar;
2049-01-01T15:34:56+00:00