PG中常用的三种timestamp
| now() | 当前时间,事物开始的时间 |
| current_timestamp | 同now() |
| clock_timestamp | 真实的当前时间,同一statement中都可能变化 |
时区
now的时区是客户端的时区,所以有必要指定时区,如
now() at time zone 'utc'
参考
PostgreSQL: Documentation: 10: 9.9. Date/Time Functions and Operators
| now() | 当前时间,事物开始的时间 |
| current_timestamp | 同now() |
| clock_timestamp | 真实的当前时间,同一statement中都可能变化 |
now的时区是客户端的时区,所以有必要指定时区,如
now() at time zone 'utc'
PostgreSQL: Documentation: 10: 9.9. Date/Time Functions and Operators
3296

被折叠的 条评论
为什么被折叠?