EXTRACT() 函数用于提取日期/时间的单独部分,比如年、月、日、小时、分钟等等。
示例:
select created_at,
EXTRACT (YEAR FROM created_at) AS year,
EXTRACT (MONTH FROM created_at) AS month,
EXTRACT (DAY FROM created_at) AS day,
EXTRACT (HOUR FROM created_at) AS hour,
EXTRACT (MINUTE FROM created_at) AS MINUTE,
EXTRACT (SECOND FROM created_at) AS SECOND
from company_contract