to_timestamp()

将时间戳字符串转换为 TIMESTAMPTZ 数据类型的函数

to_timestamp() 是一个系统函数,用于使用指定格式将时间戳的字符串表示形式转换为 TIMESTAMP WITH TIME ZONE 数据类型。

to_timestamp() 函数添加于 PostgreSQL 7.0

用法

to_timestamp ( text, text ) → timestamp with time zone

to_timestamp() 使用指定的格式将提供的字符串转换为 TIMESTAMP WITH TIME ZONE 值;有关详细信息,请参阅 PostgreSQL 文档的 日期/时间格式的模板模式 部分。

请注意,没有等效函数可以将字符串转换为普通的 TIMESTAMP 数据类型。

变更历史

分类

日期和时间, 字符串操作

另请参阅

to_date(), to_char(), to_number()

反馈

Submit any comments, suggestions or corrections for "to_timestamp()" here.