Skip to content

Database.Guide

dates

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

How to Get the First Day of the Month in Oracle

June 20, 2022 by Ian

Here’s an example of returning the first day of a given month in Oracle Database. We can return the first day of the current month, a previous or later month, or the first day of a month based on a specified date.

Read more

Categories Oracle Tags dates, how to

How to Get the Last Day of the Month in SQL

November 7, 2025June 15, 2022 by Ian

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

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

Read more

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

Add Years to a Date in SQLite

June 5, 2022 by Ian

In SQLite, we can use the DATE() function to add one or more years to a date.

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

Read more

Categories SQLite Tags dates, how to

How to Convert a Unix Timestamp to a Date/Time in SQL

May 30, 2022 by Ian

Here are examples of converting a Unix timestamp to a date/time value in some of the major RDBMSs.

The Unix timestamp (also known as Unix Epoch time, Unix time, or POSIX time) is the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC).

Read more

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

Subtract Minutes from a Time Value in SQLite

May 29, 2022 by Ian

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

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

Read more

Categories SQLite Tags dates, how to
Older posts
Newer posts
← Previous Page1 … Page14 Page15 Page16 … Page53 Next →

About | Privacy Policy

© 2026 Database.Guide • All rights reserved