The SUBDATE() function in MySQL is used to subtract a specified time or date interval from a given date and return the resulting date. Definition and Usage Purpose: Subtracts ...
The STR_TO_DATE() function in MySQL is used to convert a string into a date using a specified format. Definition and Usage Purpose: Converts a string into a date or datetime ...
The CURRENT_TIMESTAMP() function in MySQL returns the current date and time in the format YYYY-MM-DD HH:MM:SS or as a numeric value in the YYYYMMDDHHMMSS.uuuuuu format. Definiti ...
The WEEK() function in MySQL is used to extract the week number from a given date. The function returns a number representing the week of the year, which can range from 0 to 53, de ...
The DAYOFMONTH() function in MySQL returns the day of the month for a given date or datetime value. The result is a number between 1 and 31 representing the day of the month. De ...
The DATE() function in MySQL is used to extract the date part from a datetime expression, returning only the date in the format YYYY-MM-DD. Definition and Usage The DATE() fu ...
The CURTIME() function in MySQL returns the current time in the format HH:MM:SS (string) or as a numeric value in the HHMMSS.uuuuuu format. Definition and Usage The CURTIME() ...
The PERIOD_ADD() function is used to add a specified number of months to a given period. The result is returned in the YYYYMM format. Definition and Usage Purpose: Adds a spe ...
The LOCALTIMESTAMP() function returns the current date and time based on the system's local timezone. Definition and Usage The LOCALTIMESTAMP() function returns the current d ...
The YEAR() function in MySQL extracts the year part from a given date or datetime value. It returns the year as a four-digit number (ranging from 1000 to 9999). Definition and U ...
The PERIOD_DIFF() function calculates the difference in months between two periods. Both periods must be in the same format (YYMM or YYYYMM), and the result is returned as the numb ...
The LAST_DAY() function is used to extract the last day of the month for a given date. Definition and Usage The LAST_DAY() function returns the last day of the month for a gi ...
The DAYOFYEAR() function in MySQL returns the day of the year for a given date, represented as a number between 1 and 366. It is useful for determining which day of the year a spec ...
The TIME_TO_SEC() function in MySQL is used to convert a time value into the total number of seconds. Definition and Usage Purpose: Converts a given time value into seconds. ...
The SEC_TO_TIME() function in MySQL is used to convert a specified number of seconds into a time value. The result is formatted as HH:MM:SS. Definition and Usage Purpose: Con ...
The FROM_DAYS() function is used to convert a numeric day value (representing the number of days since '0000-01-01') into a date value. This function is useful for working with num ...
The ADDTIME() function is used in MySQL to add a specific time interval to a given time or datetime and return the resulting time/datetime. Definition and Usage The ADDTIME() ...
The DATE_SUB() function in MySQL is used to subtract a time/date interval from a given date and return the result. This is useful when you need to compute a date that is a certain ...
The EXTRACT() function in MySQL is used to retrieve specific parts of a date or time value. It allows you to extract components such as the year, month, day, hour, minute, second, ...
The HOUR() function extracts the hour part from a given DATETIME, DATE, or TIME value. Definition and Usage The HOUR() function returns the hour part of a given date or time ...
MySQL MONTHNAME() Function The MONTHNAME() function is used to extract the name of the month from a given date or datetime value. Definition and Usage Purpose: Retrieve the ...
The ADDDATE() function in MySQL is used to add a specific time/date interval to a given date and return the resulting date. Definition and Usage The ADDDATE() function allows ...
The TIMESTAMP() function in MySQL is used to return a datetime value based on a specified date (and optionally a time) value. Definition and Usage Purpose: The function combi ...
The DAYNAME() function in MySQL returns the full name of the weekday for a given date or datetime value. The result is the name of the weekday (e.g., "Monday", "Tuesday", etc.). ...
The SUBTIME() function in MySQL is used to subtract a specified time interval from a given time or datetime value. It returns the resulting time or datetime after the subtraction. ...
The YEARWEEK() function in MySQL returns the year and week number (a number from 0 to 53) for a given date or datetime. It combines the year and week number into a single number, w ...
The DATE_FORMAT() function in MySQL is used to format a date or datetime value according to a specified format. This allows you to present the date in a customized way, for example ...
The TIME_FORMAT() function in MySQL is used to format a given time expression according to a specific format. It allows you to display time values in various ways by using format s ...
The DATEDIFF() function in MySQL calculates the number of days between two date values. It subtracts the second date (date2) from the first (date1) and returns the difference in te ...
The MAKEDATE() function creates and returns a date based on a specified year and a number representing the day of the year. Definition and Usage Purpose: To generate a date u ...
The MAKETIME() function creates and returns a TIME value based on the specified hour, minute, and second values. Definition and Usage The function takes hour, minute, and ...
The SECOND() function in MySQL is used to return the seconds part from a given time or datetime value. The result will be a number between 0 and 59. Definition and Usage Purp ...
The MONTH() function is used to extract the month part from a given date or datetime value. Definition and Usage Purpose: Extract the month component from a date or datetime ...
The DAYOFWEEK() function in MySQL returns the weekday index for a given date, where the result is a number between 1 and 7. This index corresponds to the days of the week, starting ...
The CURDATE() function in MySQL returns the current date. It is useful for retrieving today's date in your queries. Definition and Usage The CURDATE() function returns the cu ...
The TO_DAYS() function in MySQL is used to return the number of days between a given date and the "zero" date, which is defined as the start of the Gregorian calendar, i.e., 0000-0 ...
The DATE_ADD() function in MySQL is used to add a specified time/date interval to a date and return the new date. It is commonly used for date arithmetic operations such as adding ...
The MICROSECOND() function extracts and returns the microsecond part of a time or datetime value as an integer (ranging from 0 to 999999). Definition and Usage This function ...
The CURRENT_DATE() function in MySQL returns the current date. This function is equivalent to the CURDATE() function. Definition and Usage The CURRENT_DATE() function returns ...
The WEEKDAY() function in MySQL is used to return the weekday number for a given date. It assigns a numerical value to each day of the week, with Monday being 0 and Sunday being 6. ...
The MINUTE() function is used to extract the minute part from a given time or datetime value. Definition and Usage Purpose: To extract the minute component of a time/datetime ...
The NOW() function retrieves the current date and time from the server. It is commonly used in queries to log timestamps or compare data with the current datetime. Definition an ...
The QUARTER() function is used to return the quarter of the year for a given date. The result will be an integer value from 1 to 4, depending on the month of the provided date. ...
The WEEKOFYEAR() function in MySQL is used to return the week number for a given date, where the first week of the year is determined as the one that contains the first Thursday of ...
The TIME() function in MySQL is used to extract the time part from a given time or datetime expression. This function is useful when you want to discard the date portion of a datet ...
The CURRENT_TIME() function in MySQL returns the current time in the format HH:MM:SS or as a numeric value in the HHMMSS.uuuuuu format. Definition and Usage The CURRENT_TIME( ...
The SYSDATE() function in MySQL is used to return the current date and time at the moment the function is executed. Unlike NOW(), which returns the time when the query starts execu ...
The DAY() function in MySQL is used to return the day of the month from a given date or datetime value. The result is an integer between 1 and 31, representing the day of the month ...
The TIMEDIFF() function in MySQL is used to return the difference between two time or datetime expressions. Definition and Usage Purpose: The function calculates the differen ...
The LOCALTIME() function is used to return the current date and time in the system's local timezone. Definition and Usage The LOCALTIME() function returns the current date an ...