Skip to content

Database.Guide

dates

Add Minutes to a Time Value in PostgreSQL

October 18, 2022 by Ian

In PostgreSQL, we can use the + operator to add one or more minutes to a time value.

By “time” value, this could be an actual time value, a timestamp, or an interval. We can also add minutes to a date value or a date and time combination.

Read more

Categories PostgreSQL Tags dates, how to, psql

Add Hours to a Time Value in SQLite

October 10, 2022 by Ian

In SQLite, we can use the TIME() function to add a given number of hours to a time value.

If we’re dealing with datetime values, we can use the DATETIME() function.

Read more

Categories SQLite Tags dates, how to

Subtract Seconds from a Time Value in PostgreSQL

September 18, 2022 by Ian

In PostgreSQL, we can use the - operator to subtract one or more seconds from a time value.

By “time” value, this could be an actual time value, a timestamp, or an interval. We can also subtract seconds from a date value or a date and time combination.

Read more

Categories PostgreSQL Tags dates, how to, psql

How to Get the First Day of the Month in SQL

September 8, 2022 by Ian

Below are examples of using SQL to return the first day of the month across various DBMSs.

This could be the first day of the current month, or the first day of a month based on a given date.

Read more

Categories MariaDB, MySQL, Oracle, PostgreSQL, SQL, SQL Server, SQLite Tags dates, how to

Subtract Months from a Date in SQLite

September 4, 2022 by Ian

In SQLite, we can use the DATE() function to subtract one or more months from a date.

For datetime values, we can use the DATETIME() function.

Read more

Categories SQLite Tags dates, how to

Get the First, Second, Third, or Fourth Monday of a Year in SQLite

August 30, 2022 by Ian

We can use SQLite’s DATE() function to return the first, second, third, fourth, etc instance of a given day within a given year.

We can use the same technique to return the first Monday of each month in the year.

It’s not limited to Monday though. The same techniques can be used on Tuesday, Wednesday, Thursday, Friday, etc.

Read more

Categories SQLite Tags dates, how to

Add Seconds to a Time Value in PostgreSQL

August 24, 2022 by Ian

In PostgreSQL, we can use the + operator to add one or more seconds to a time value.

By “time” value, this could be an actual time value, a timestamp, or an interval. We can also add seconds to a date value or a date and time combination.

Read more

Categories PostgreSQL Tags dates, how to, psql

Subtract Seconds from a Time Value in SQLite

August 8, 2022 by Ian

In SQLite, we can use the TIME() function to subtract one or more seconds from a time value.

For datetime values, we can use the DATETIME() function.

Read more

Categories SQLite Tags dates, how to

Subtract Hours from a Time Value in SQLite

July 15, 2022 by Ian

In SQLite, we can use the TIME() function to subtract one or more hours from a time value.

For datetime values, we can use the DATETIME() function.

Read more

Categories SQLite Tags dates, how to

3 Ways to Get the Start of the Month in MariaDB

July 11, 2022 by Ian

Here are three options for returning the first day of a month in MariaDB.

This could be the first day of the current month, or the first day of the month based on a date that we specify.

Read more

Categories MariaDB Tags dates, how to
Older posts
Newer posts
← Previous Page1 … Page13 Page14 Page15 … Page52 Next →

About | Privacy Policy

© 2026 Database.Guide • All rights reserved