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 (148)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (299)

Tag: date functions

QUARTER() Examples – MySQL

Posted on June 30, 2018January 28, 2021 by Ian

In MySQL, the QUARTER() function returns the quarter of the year of a given date.

This function accepts one argument – the date to extract the quarter from.

Continue reading →

MySQL date functions, dates, functions

PERIOD_DIFF() Examples – MySQL

Posted on June 29, 2018January 28, 2021 by Ian

MySQL has a PERIOD_DIFF() function that enables you to find the difference between two periods. The periods are provided as two separate arguments, and they should in the format YYMM or YYYYMM.

Continue reading →

MySQL date functions, dates, functions

PERIOD_ADD() Examples – MySQL

Posted on June 29, 2018January 28, 2021 by Ian

MySQL has a PERIOD_ADD() function that allows you to add a number of months to a given period. It returns a value in the format YYYYMM.

This article provides examples to demonstrate how it works.

Continue reading →

MySQL date functions, dates, functions

MONTHNAME() Examples – MySQL

Posted on June 28, 2018October 17, 2021 by Ian

In MySQL, the MONTHNAME() function returns the month name from a date.

For example, if you provide a date of 2021-12-07, the MONTHNAME() function will return December.

Continue reading →

MySQL date functions, dates, functions

MONTH() Examples – MySQL

Posted on June 28, 2018January 28, 2021 by Ian

You can use the MONTH() function in MySQL to return the month from a date.

In this context, the month is a value between 1 and 12 (or 0 for dates with a zero month part).

For example, if you provide a date of 2018-10-07, the MONTH() function will return 10.

Continue reading →

MySQL date functions, dates, functions

MAKETIME() Examples – MySQL

Posted on June 28, 2018January 28, 2021 by Ian

When using MySQL, you can use the MAKETIME() function to return a time from the various time parts.

In other words, you provide three arguments; the hour, the minutes, and the seconds. The MAKETIME() function will then return the time value based on those two arguments.

Continue reading →

MySQL date functions, dates, functions

MAKEDATE() Examples – MySQL

Posted on June 28, 2018January 28, 2021 by Ian

When using MySQL, you can use the MAKEDATE() function to return a date from the year and day-of-year parts.

In other words, you provide two arguments; one being the year, and the other being the day-of-year. The MAKEDATE() function will then return the date value based on those two arguments.

Continue reading →

MySQL date functions, dates, functions

LOCALTIME Examples – MySQL

Posted on June 27, 2018January 28, 2021 by Ian

The MySQL LOCALTIME function is a synonym for the NOW() function. It returns the current date and time.

The value is returned in ‘YYYY-MM-DD HH:MM:SS’ or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context.

Continue reading →

MySQL date functions, dates, functions

LOCALTIMESTAMP Examples – MySQL

Posted on June 27, 2018January 28, 2021 by Ian

The MySQL LOCALTIMESTAMP function is a synonym for the NOW() function. It returns the current date and time.

The value is returned in ‘YYYY-MM-DD HH:MM:SS’ or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context.

Continue reading →

MySQL date functions, dates, functions

LAST_DAY() Examples – MySQL

Posted on June 27, 2018January 28, 2021 by Ian

When using MySQL, you can use the LAST_DAY() function to return the last day of a given month.

You can provide the current date, or you can provide another specified date (for example, a date from a column in a database), and LAST_DAY() will return the last day of the month for that date.

Continue reading →

MySQL date functions, dates, functions
  • «
  • 1
  • …
  • 20
  • 21
  • 22
  • 23
  • 24
  • …
  • 31
  • »

About Database.Guide | Privacy Policy