PostgreSQL之日期时间小结

发布于:2023-09-14 ⋅ 阅读:(204) ⋅ 点赞:(0)
试读部分
PostgreSQL关于时间日期的语法及注意事项 sql时间用法 获取当前日期的函数&&获取当前时间的函数 获取当前日期的函数 获取当前时间的函数 获取当前日期加时间的函数 函数: current_timestamp 函数: transaction_timestamp() 函数: statement_timestamp() 函数: clock_timestamp() 函数: timeofday() 函数: now() 延迟执行 函数: pg_sleep() 函数: pg_sleep_for () 函数: pg_sleep_until() 时间和日期函数 to_char(timestamp, text) to_char(int, text) to_char(double precision, text) to_date(text, text) to_number(text, text) to_timestamp(text, text) date - date date_part(text, timestamp) date_trunc(text, timestamp) extract(field from timestamp) make_date(year int, month int, day int) 使用timestamp来比较时间 使用interval添加时间 致谢 sql时间用法 PostgreSQL 提供了大量用于获取系统当前日期和时间的函数,例如 current_date、current_time、 current_timestamp、clock_timestamp()、localtimestamp、now()、statement_timestamp()等;同时还 支持延迟语句执行的 pg_sleep()等函数 数据库有很多,mysql、sqlserver等存在存……
本文为 VIP 文章,已展示部分内容,开通 VIP 后查看全文

觉得这篇文章有帮助?

点个赞,或赞赏支持作者持续创作

微信公众号

今日签到

点亮在社区的每一天
去签到