我想使用 PHP pg_query_params 方法将 unix 时间戳值插入 postgres 时间戳列,但被卡住了。
这是不完整的代码:
$con = pg_connect(...);
$stmt = 'INSERT INTO my_table (submitted) VALUES ($1)';
$ts = 1479939387;
$values = [translate_timestamp_into_sth_postgres_accepts($ts)];
$res = pg_query_params($con, $stmt, $values);
问:如何将 unix seconds 值转换为 sth。postgres 接受吗?