date_part
date_part
The date_part function is developed based on the traditional Ingres function (this function is equivalent to the SQL standard function extract):
date_part('field', source)
Here, the field must be a string instead of a name. The valid field is the same as those of extract. For details, see EXTRACT.
Example:
1 2 3 4 5 |
postgres=#SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40'); date_part ----------- 16 (1 row) |
1 2 3 4 5 |
postgres=#SELECT date_part('hour', INTERVAL '4 hours 3 minutes'); date_part ----------- 4 (1 row) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot