rim*_*mas 2 c c++ postgresql timestamp
如何将 time_t 结构中收到的时间/日期插入到“没有时区的时间戳”类型的列中?
以前我使用 int8 作为数据类型,并且 time_t 非常适合,但我想知道如何使用 PQexecParams 调用来使用时间戳字段(最好不要将 time_t 从调用程序转换为字符串)。
使用to_timestamp函数。例子:
select to_timestamp(1000000000)::timestamp;
Run Code Online (Sandbox Code Playgroud)
结果:
to_timestamp -------------------- 2001-09-09 03:46:40 1行)
归档时间: |
|
查看次数: |
4545 次 |
最近记录: |