SYSDATE() function in MySQL Last Updated : 27 Nov, 2020 Comments Improve Suggest changes Like Article Like Report SYSDATE() function in MySQL is used to return the current date and time in YYYY-MM-DD HH:MM:SS or YYYYMMDDHHMMSS.uuuuuu format depending on the context of the function. Syntax : SYSDATE() Parameter : This method does not accept any parameter. Returns : It returns the current date and time value. Example-1 : Getting the current date and time using SYSDATE Function. SELECT SYSDATE() as CurrentDateAndTime ; Output : CurrentDateAndTime 2020-11-26 01:31:14 Example-2 : Getting the current date and time using SYSDATE Function in numeric format. SELECT SYSDATE() + 0 as CurrDateAndTime ; Output : CURRDATEANDTIME 20201126013648 Example-3 : The SYSDATE function can be used to set value of columns. To demonstrate create a table named DeliveryDetails. CREATE TABLE DeliveryDetails ( DeliveryId INT AUTO_INCREMENT, ProductId INT NOT NULL, ProductName VARCHAR(20) NOT NULL, Delivered_At TIMESTAMP NOT NULL, PRIMARY KEY(DeliveryId) ); Here, we will use SYSDATE function when a delivery will be completed. The value in Delivered_At column will be the value given by SYSDATE Function. INSERT INTO DeliveryDetails(ProductId, ProductName, Delivered_At) VALUES (94567, 'Acer Helios', SYSDATE()); Now, checking the DeliveryDetails table : SELECT * FROM DeliveryDetails; Output : DeliveryId ProductId ProductName Delivered_At 1 94567 Acer Helios 2020-11-26 01:40:57 Comment More infoAdvertise with us Next Article SYSDATE() function in MySQL jana_sayantan Follow Improve Article Tags : SQL DBMS-SQL mysql Similar Reads SUBDATE() function in MySQL SUBDATE() function in MySQL is used to subtracts a time value (as interval) from a given date. Syntax : SUBDATE(date, INTERVAL expr unit) Parameter : This function accepts three parameters as given below : date : First specified date. expr : The value of the time/date interval to subtract. unit : Th 2 min read TIME() Function in MySQL The TIME() function in MySQL is used to extract the time portion from a date or datetime expression, returning the time in the format 'HH:MM'. This function is particularly useful when working with time components in databases, such as scheduling or logging systems. In this article, We will learn ab 4 min read YEAR() Function in MySQL YEAR() function in MySQL is used to find year from the given date. If the date is NULL, the YEAR() function will return NULL. Otherwise, it returns value range from 1000 to 9999. Syntax : YEAR(date) Parameter : This method accepts one parameter as mentioned above and described below : date : The dat 3 min read SQRT() Function in MySQL The SQRT() function in MySQL calculates the square root of a non-negative number, returning NULL for negative inputs. It is a built-in function that provides high precision and is optimized for performance and making it ideal for mathematical and scientific applications.In the article, we will cover 3 min read TAN() Function in MySQL TAN() function : This function in MySQL is used to return the tangent of a specified number. In any right triangle, the tangent of an angle is the length of the opposite side divided by the length of the adjacent side. Similarly, this can also be defined as tangent of x is the sine of x divided by t 1 min read SECOND() Function in MySQL SECOND() function in MySQL is used to return the second portion of a specified time or date-time value. The first parameter in this function will be the date/Date Time. This function returns the seconds from the given date value. The return value (seconds) will be in the range of 0 to 59. In this fu 2 min read TRUNCATE() Function in MySQL The TRUNCATE() function in MySQL is a valuable tool for manipulating numerical values by removing their decimal parts without rounding. It allows us to limit the precision of numbers to a specified number of decimal places or even truncate them to the nearest integer. In this article, We will learn 6 min read WEEKDAY() Function in MySQL WEEKDAY() function in MySQL is used to find the weekday value for a given date. If the date is NULL, the WEEKDAY() function will return NULL. Otherwise, it returns index for a date i.e., 0 for Monday, 1 for Tuesday, ⦠6 for Sunday. Syntax : WEEKDAY(date) Parameter : This method accepts one parameter 3 min read SEC_TO_TIME() Function in MySQL SEC_TO_TIME() function : This function in MySQL is used to return a time value based on the specified seconds value. Here the returned time value will be in the format of HH:MM:SS. For example, if the specified second value is 63, this function will return "00:01:03". Syntax : SEC_TO_TIME(seconds) P 1 min read Like