![]() ![]() SELECT extract ( year from now ( ) ) -> 2022 SELECT extract ( hour from now ( ) ) -> 16 SELECT extract ( minute from now ( ) ) -> 4 age()Ĭalculates the difference, or age, between 2 timestamps. The full list of fields names can be found in the official documentation. Common field names are: year, month, day, hour, minute, second. Retrieves subfields such as year or hour from date/time values. Note: This function must not be called with function brackets (). SELECT current_date current_date - 2022 - 09 - 08 current_time Returns a timestamp with timezone SELECT now ( ) There are many Date / Time related functions available, but the following ones are commonly used: now() See this article for details about parsing rules. To create a constant of a date / time type, use the name of the type followed by the literal input string, enclosed in single quotes.Įxamples: SELECT timestamp ' 16:19:51.397118' SELECT date '' SELECT time '16:19:51' SELECT interval '3 months' SELECT interval '3 months 2 days 1 minutes' time - time of day (with optional time zone)ĭetails about each type can be found in the official documentation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |