Database.Guide

Skip to content

Beginners

  • What is a Database?
  • Database Tutorial

SQL

  • SQL Tutorial
  • SQL Reference
  • SQL Joins Tutorial
  • SQL Transactions Tutorial
  • Basic SQL Queries

Categories

  • Azure SQL Edge (17)
  • Database Concepts (99)
  • Database Tools (72)
  • DBMS (9)
  • DuckDB (171)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (300)

Tag: date functions

How to_date() Works in PostgreSQL

Posted on July 10, 2020September 5, 2021 by Ian

In PostgreSQL, you can use the to_date() function to convert a string to a date.

Continue reading →
PostgreSQL conversion functions, date functions, dates, functions, what is

How current_timestamp() Works in PostgreSQL

Posted on July 9, 2020January 28, 2021 by Ian

In PostgreSQL, the current_timestamp() function returns the current date and time, including the time zone offset.

The timestamp returned is based on the start time of the current transaction.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How LocalTimeStamp() Works in PostgreSQL

Posted on July 9, 2020January 28, 2021 by Ian

In PostgreSQL, the localtimestamp() function returns the local date and time, without the time zone offset.

If you need the time zone offset, use current_timestamp() instead.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How date_part() Works in PostgreSQL

Posted on July 8, 2020January 28, 2021 by Ian

In PostgreSQL, the date_part() function retrieves subfields such as the year, month, hour, or minute, part from a date/time value.

It’s equivalent to the extract() function, although with a slightly different syntax.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How Extract() Works in PostgreSQL

Posted on July 8, 2020October 18, 2021 by Ian

In PostgreSQL, the extract() function retrieves subfields such as the year, month, hour, or minute, part from a date/time value.

It’s equivalent to the date_part() function, although with a slightly different syntax.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How justify_interval() Works in PostgreSQL

Posted on July 8, 2020January 28, 2021 by Ian

In PostgreSQL, the justify_interval() function adjusts an interval using justify_days and justify_hours. It allows you to use additional sign adjustments to adjust the interval.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How justify_days() Works in PostgreSQL

Posted on July 8, 2020January 28, 2021 by Ian

In PostgreSQL, the justify_days() function allows you to adjust an interval value, so that 30-day time periods are represented as months.

For example, if you have an interval of say, 30 days, justify_days() will return it as 1 mon.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How justify_hours() Works in PostgreSQL

Posted on July 8, 2020January 28, 2021 by Ian

In PostgreSQL, the justify_hours() function allows you to adjust an interval value, so that 24-hour time periods are represented as days.

For example, if you have an interval of say, 24 hours justify_hours() will return it as 1 day.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How IsFinite() Works in PostgreSQL

Posted on July 7, 2020January 28, 2021 by Ian

In PostgreSQL, the isfinite() function tests for a finite date, timestamp or interval.

This can be useful, because Postgres supports infinite dates/timestamps. For example, you could have a timestamp of infinity or negative infinity, and this function allows you to test for that.

Continue reading →
PostgreSQL date functions, dates, functions, what is

How pg_typeof() Works in PostgreSQL

Posted on July 7, 2020January 28, 2021 by Ian

In PostgreSQL, the pg_typeof() function allows you to get the data type of any value.

More specifically, it returns the OID of the data type of the value that is passed to it. It returns a regtype, which is an OID alias type. Therefore it’s the same as an OID for comparison purposes but displays as a type name.

Continue reading →
PostgreSQL date functions, dates, functions, what is
  • «
  • 1
  • …
  • 14
  • 15
  • 16
  • 17
  • 18
  • …
  • 31
  • »

About Database.Guide | Privacy Policy