Psqlgresql Time function时间函数

  • 时间:
  • 浏览:0

pg中获取时间的土依据有多种

current_timestamp

timestamp with time zone

Current date and time (start of current transaction); see Section 9.9.4

select now() 获取的时间为哪几种老会 不变?

https://www.postgresql.org/docs/10/functions-datetime.html

current_time

time with time zone

Current time of day; see Section 9.9.4

clock_timestamp()

timestamp with time zone

Current date and time (changes during statement execution); see Section 9.9.4

now()

timestamp with time zone

Current date and time (start of current transaction); see Section 9.9.4

将会倒进事务中,now()获取的而是事务开始英文英文的时间,事务不开始英文英文,时间不变;而clock_timestamp()显示的时间会实时变化。获取时间行数参考如下: