{"Entry":{"collection":"func","key":"clock-timestamp","name":"clock_timestamp","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.1","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.2"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"},{"descriptions_changed":true,"doc_overhaul":false,"from":"13","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"14"}],"content_hash":"dcec58ce5ff2c26f16faaa915f8bce9080c592ce9988f89082e05dce181ae3eb","first_version":"8.2","group":"datetime","group_label":"Date/Time Functions And Operators","groups":["datetime"],"imported_at":"2026-09-27T17:57:28.509253+08:00","last_version":"20","name":"clock_timestamp","name_key":"clock_timestamp","position":8001,"present_in":["8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"clock_timestamp ( ) → timestamp with time zone","signature_count":2,"slug":"clock-timestamp","source_rev":"b7bd9cda","summary":"Current date and time (changes during statement execution); see Section 9.9.5","summary_zh":""}},"Definition":{"Collection":"func","Key":"clock-timestamp","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"clock-timestamp","SourceRevision":"b7bd9cda","Facts":{"description":"Current date and time (changes during statement execution); see Section 9.9.5","description_html":"Current date and time (changes during statement execution); see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" title=\"9.9.5. Current Date/Time\"\u003eSection 9.9.5\u003c/a\u003e","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","slug":"18"},"group":"datetime","group_label":"Date/Time Functions And Operators","lang":"en","layout":"table-new","pages":["functions-datetime.html"],"prose_only":false,"signatures":[{"description":"Current date and time (changes during statement execution); see Section 9.9.5","description_html":"Current date and time (changes during statement execution); see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" title=\"9.9.5. Current Date/Time\"\u003eSection 9.9.5\u003c/a\u003e","description_zh":"","description_zh_html":"","examples":[{"expr":"clock_timestamp()","result":"2019-12-23 14:39:53.662522-05"}],"html":"\u003ccode class=\"function\"\u003eclock_timestamp\u003c/code\u003e ( ) → \u003ccode class=\"returnvalue\"\u003etimestamp with time zone\u003c/code\u003e","returns":"timestamp with time zone","text":"clock_timestamp ( ) → timestamp with time zone","zh_from":""},{"description":"transaction_timestamp() is equivalent to CURRENT_TIMESTAMP, but is named to clearly reflect what it returns. statement_timestamp() returns the start time of the current statement (more specifically, the time of receipt of the latest command message from the client). statement_timestamp() and transaction_timestamp() return the same value during the first statement of a transaction, but might differ during subsequent statements. clock_timestamp() returns the actual current time, and therefore its value changes even within a single SQL statement. timeofday() is a historical PostgreSQL function. Like clock_timestamp(), it returns the actual current time, but as a formatted text string rather than a timestamp with time zone value. now() is a traditional PostgreSQL equivalent to transaction_timestamp().","description_html":"\u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e is equivalent to \u003ccode class=\"function\"\u003eCURRENT_TIMESTAMP\u003c/code\u003e, but is named to clearly reflect what it returns. \u003ccode class=\"function\"\u003estatement_timestamp()\u003c/code\u003e returns the start time of the current statement (more specifically, the time of receipt of the latest command message from the client). \u003ccode class=\"function\"\u003estatement_timestamp()\u003c/code\u003e and \u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e return the same value during the first statement of a transaction, but might differ during subsequent statements. \u003ccode class=\"function\"\u003eclock_timestamp()\u003c/code\u003e returns the actual current time, and therefore its value changes even within a single SQL statement. \u003ccode class=\"function\"\u003etimeofday()\u003c/code\u003e is a historical \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e function. Like \u003ccode class=\"function\"\u003eclock_timestamp()\u003c/code\u003e, it returns the actual current time, but as a formatted \u003ccode class=\"type\"\u003etext\u003c/code\u003e string rather than a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e value. \u003ccode class=\"function\"\u003enow()\u003c/code\u003e is a traditional \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e equivalent to \u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003eclock_timestamp\u003c/code\u003e()","returns":"","text":"clock_timestamp()","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-DATETIME-TABLE","file":"functions-datetime.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"clock-timestamp","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"clock_timestamp","Summary":"当前日期和时间（在语句执行期间变化）；参见第 9.9.5 节","BodyHTML":"当前日期和时间（在语句执行期间变化）；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" rel=\"nofollow\"\u003e第 9.9.5 节\u003c/a\u003e\u003cpre\u003eclock_timestamp ( ) → timestamp with time zone\u003c/pre\u003e当前日期和时间（在语句执行期间变化）；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" rel=\"nofollow\"\u003e第 9.9.5 节\u003c/a\u003e\u003cpre\u003eclock_timestamp()\u003c/pre\u003e\u003ccode\u003etransaction_timestamp()\u003c/code\u003e等价于\u003ccode\u003eCURRENT_TIMESTAMP\u003c/code\u003e，但是其命名清楚地反映了它的返回值。\u003ccode\u003estatement_timestamp()\u003c/code\u003e返回当前语句的开始时刻（更准确地说，是接收到客户端最近一条命令消息的时间）。\u003ccode\u003estatement_timestamp()\u003c/code\u003e和\u003ccode\u003etransaction_timestamp()\u003c/code\u003e在一个事务的第一条语句期间返回值相同，但是在随后的语句中却不一定相同。\u003ccode\u003eclock_timestamp()\u003c/code\u003e返回真正的当前时间，因此它的值甚至在同一条 SQL 语句中都会变化。\u003ccode\u003etimeofday()\u003c/code\u003e是一个有历史原因的\u003cspan\u003ePostgreSQL\u003c/span\u003e函数。和\u003ccode\u003eclock_timestamp()\u003c/code\u003e相似，它也返回真实的当前时间，但是它的结果是一个格式化的\u003ccode\u003etext\u003c/code\u003e串，而不是\u003ccode\u003etimestamp with time zone\u003c/code\u003e值。\u003ccode\u003enow()\u003c/code\u003e是\u003cspan\u003ePostgreSQL\u003c/span\u003e中与\u003ccode\u003etransaction_timestamp()\u003c/code\u003e等价的传统函数。","SourceRevision":"ca936764","ContentHash":"54783589b14f67c398c9196a08294015cf3e8d6e203c0d43886d4e122ae0a6ad","Payload":{"description_zh":"当前日期和时间（在语句执行期间变化）；参见第 9.9.5 节","description_zh_html":"当前日期和时间（在语句执行期间变化）；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" title=\"9.9.5. 当前日期/时间\"\u003e第 9.9.5 节\u003c/a\u003e","signatures":[{"description_zh":"当前日期和时间（在语句执行期间变化）；参见第 9.9.5 节","description_zh_html":"当前日期和时间（在语句执行期间变化）；参见\u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" title=\"9.9.5. 当前日期/时间\"\u003e第 9.9.5 节\u003c/a\u003e","returns":"timestamp with time zone","text":"clock_timestamp ( ) → timestamp with time zone","zh_from":"doc"},{"description_zh":"transaction_timestamp()等价于CURRENT_TIMESTAMP，但是其命名清楚地反映了它的返回值。statement_timestamp()返回当前语句的开始时刻（更准确地说，是接收到客户端最近一条命令消息的时间）。statement_timestamp()和transaction_timestamp()在一个事务的第一条语句期间返回值相同，但是在随后的语句中却不一定相同。clock_timestamp()返回真正的当前时间，因此它的值甚至在同一条 SQL 语句中都会变化。timeofday()是一个有历史原因的PostgreSQL函数。和clock_timestamp()相似，它也返回真实的当前时间，但是它的结果是一个格式化的text串，而不是timestamp with time zone值。now()是PostgreSQL中与transaction_timestamp()等价的传统函数。","description_zh_html":"\u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e等价于\u003ccode class=\"function\"\u003eCURRENT_TIMESTAMP\u003c/code\u003e，但是其命名清楚地反映了它的返回值。\u003ccode class=\"function\"\u003estatement_timestamp()\u003c/code\u003e返回当前语句的开始时刻（更准确地说，是接收到客户端最近一条命令消息的时间）。\u003ccode class=\"function\"\u003estatement_timestamp()\u003c/code\u003e和\u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e在一个事务的第一条语句期间返回值相同，但是在随后的语句中却不一定相同。\u003ccode class=\"function\"\u003eclock_timestamp()\u003c/code\u003e返回真正的当前时间，因此它的值甚至在同一条 SQL 语句中都会变化。\u003ccode class=\"function\"\u003etimeofday()\u003c/code\u003e是一个有历史原因的\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e函数。和\u003ccode class=\"function\"\u003eclock_timestamp()\u003c/code\u003e相似，它也返回真实的当前时间，但是它的结果是一个格式化的\u003ccode class=\"type\"\u003etext\u003c/code\u003e串，而不是\u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e值。\u003ccode class=\"function\"\u003enow()\u003c/code\u003e是\u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e中与\u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e等价的传统函数。","returns":"","text":"clock_timestamp()","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"1384a686ea8337408bb590ee2244e783b70b70b4d1aeed9c96896b4113b892b8","Text":"clock_timestamp ( ) → timestamp with time zone","Returns":"timestamp with time zone","Payload":{"description":"Current date and time (changes during statement execution); see Section 9.9.5","description_html":"Current date and time (changes during statement execution); see \u003ca href=\"/docs/18/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT\" title=\"9.9.5. Current Date/Time\"\u003eSection 9.9.5\u003c/a\u003e","description_zh":"","description_zh_html":"","examples":[{"expr":"clock_timestamp()","result":"2019-12-23 14:39:53.662522-05"}],"html":"\u003ccode class=\"function\"\u003eclock_timestamp\u003c/code\u003e ( ) → \u003ccode class=\"returnvalue\"\u003etimestamp with time zone\u003c/code\u003e","returns":"timestamp with time zone","text":"clock_timestamp ( ) → timestamp with time zone","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"7b48427210d5cc6a97145a5c4d83d56c06969b180783c3aaadf8e21c9da9f19b","Text":"clock_timestamp()","Returns":"","Payload":{"description":"transaction_timestamp() is equivalent to CURRENT_TIMESTAMP, but is named to clearly reflect what it returns. statement_timestamp() returns the start time of the current statement (more specifically, the time of receipt of the latest command message from the client). statement_timestamp() and transaction_timestamp() return the same value during the first statement of a transaction, but might differ during subsequent statements. clock_timestamp() returns the actual current time, and therefore its value changes even within a single SQL statement. timeofday() is a historical PostgreSQL function. Like clock_timestamp(), it returns the actual current time, but as a formatted text string rather than a timestamp with time zone value. now() is a traditional PostgreSQL equivalent to transaction_timestamp().","description_html":"\u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e is equivalent to \u003ccode class=\"function\"\u003eCURRENT_TIMESTAMP\u003c/code\u003e, but is named to clearly reflect what it returns. \u003ccode class=\"function\"\u003estatement_timestamp()\u003c/code\u003e returns the start time of the current statement (more specifically, the time of receipt of the latest command message from the client). \u003ccode class=\"function\"\u003estatement_timestamp()\u003c/code\u003e and \u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e return the same value during the first statement of a transaction, but might differ during subsequent statements. \u003ccode class=\"function\"\u003eclock_timestamp()\u003c/code\u003e returns the actual current time, and therefore its value changes even within a single SQL statement. \u003ccode class=\"function\"\u003etimeofday()\u003c/code\u003e is a historical \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e function. Like \u003ccode class=\"function\"\u003eclock_timestamp()\u003c/code\u003e, it returns the actual current time, but as a formatted \u003ccode class=\"type\"\u003etext\u003c/code\u003e string rather than a \u003ccode class=\"type\"\u003etimestamp with time zone\u003c/code\u003e value. \u003ccode class=\"function\"\u003enow()\u003c/code\u003e is a traditional \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e equivalent to \u003ccode class=\"function\"\u003etransaction_timestamp()\u003c/code\u003e.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003eclock_timestamp\u003c/code\u003e()","returns":"","text":"clock_timestamp()","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
